From 47878e0c59e5f1ecae2a6036884f34f5547f3cb9 Mon Sep 17 00:00:00 2001 From: Panayiotis Halouvas Date: Fri, 21 Feb 2025 05:17:11 +0000 Subject: [PATCH 01/10] Bump version to 4.10.0 --- swissmedhealth/__init__.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/swissmedhealth/__init__.py b/swissmedhealth/__init__.py index 43e14c6..8e85738 100644 --- a/swissmedhealth/__init__.py +++ b/swissmedhealth/__init__.py @@ -1 +1 @@ -__version__ = '4.9.11' +__version__ = '4.10.0' From ef438c387d186b1d45d4df9fac1397cf47bece89 Mon Sep 17 00:00:00 2001 From: Panayiotis Halouvas Date: Fri, 21 Feb 2025 06:43:30 +0000 Subject: [PATCH 02/10] Add Longevity History doctype and related files --- .../swissmedhealth/custom/lead.json | 243 +++-- .../swissmedhealth/custom/patient.json | 84 +- .../doctype/longevity_history/__init__.py | 0 .../longevity_history/longevity_history.js | 8 + .../longevity_history/longevity_history.json | 964 ++++++++++++++++++ .../longevity_history/longevity_history.py | 9 + .../test_longevity_history.py | 9 + 7 files changed, 1229 insertions(+), 88 deletions(-) create mode 100644 swissmedhealth/swissmedhealth/doctype/longevity_history/__init__.py create mode 100644 swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.js create mode 100644 swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.json create mode 100644 swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.py create mode 100644 swissmedhealth/swissmedhealth/doctype/longevity_history/test_longevity_history.py diff --git a/swissmedhealth/swissmedhealth/custom/lead.json b/swissmedhealth/swissmedhealth/custom/lead.json index ee6a24d..f288a99 100644 --- a/swissmedhealth/swissmedhealth/custom/lead.json +++ b/swissmedhealth/swissmedhealth/custom/lead.json @@ -608,7 +608,7 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "custom_stress_identification", + "insert_after": "custom_longevity_history", "is_system_generated": 0, "is_virtual": 0, "label": "Customer Consent", @@ -1216,6 +1216,70 @@ "unique": 0, "width": null }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2025-02-21 08:05:09.921171", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Lead", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_longevity_history", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 109, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_stress_identification", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Longevity History", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2025-02-21 08:07:23.136070", + "modified_by": "Administrator", + "module": "Swissmedhealth", + "name": "Lead-custom_longevity_history", + "no_copy": 0, + "non_negative": 0, + "options": "Longevity History", + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, { "_assign": null, "_comments": null, @@ -2766,7 +2830,7 @@ "is_child_table": 0, "link_doctype": "Customer", "link_fieldname": "lead_name", - "modified": "2024-12-31 08:50:15.209066", + "modified": "2025-02-21 08:05:09.737547", "modified_by": "Administrator", "name": "5e28045776", "owner": "Administrator", @@ -2791,7 +2855,7 @@ "field_name": "activities_tab", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:54.998705", + "modified": "2025-02-21 07:11:32.933557", "modified_by": "Administrator", "module": null, "name": "Lead-activities_tab-print_hide", @@ -2814,7 +2878,7 @@ "field_name": "address_html", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.014530", + "modified": "2025-02-21 07:11:32.949861", "modified_by": "Administrator", "module": null, "name": "Lead-address_html-print_hide", @@ -2837,7 +2901,7 @@ "field_name": "address_section", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.029398", + "modified": "2025-02-21 07:11:32.964935", "modified_by": "Administrator", "module": null, "name": "Lead-address_section-print_hide", @@ -2860,7 +2924,7 @@ "field_name": "all_activities_html", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.044864", + "modified": "2025-02-21 07:11:32.979379", "modified_by": "Administrator", "module": null, "name": "Lead-all_activities_html-print_hide", @@ -2883,7 +2947,7 @@ "field_name": "all_activities_section", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.061048", + "modified": "2025-02-21 07:11:32.994048", "modified_by": "Administrator", "module": null, "name": "Lead-all_activities_section-print_hide", @@ -2906,7 +2970,7 @@ "field_name": "annual_revenue", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.076380", + "modified": "2025-02-21 07:11:33.008583", "modified_by": "Administrator", "module": null, "name": "Lead-annual_revenue-print_hide", @@ -2929,7 +2993,7 @@ "field_name": "blog_subscriber", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.091743", + "modified": "2025-02-21 07:11:33.023295", "modified_by": "Administrator", "module": null, "name": "Lead-blog_subscriber-print_hide", @@ -2952,7 +3016,7 @@ "field_name": "campaign_name", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.105929", + "modified": "2025-02-21 07:11:33.038693", "modified_by": "Administrator", "module": null, "name": "Lead-campaign_name-print_hide", @@ -2975,7 +3039,7 @@ "field_name": "city", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.120264", + "modified": "2025-02-21 07:11:33.054281", "modified_by": "Administrator", "module": null, "name": "Lead-city-fetch_from", @@ -2998,7 +3062,7 @@ "field_name": "city", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.134935", + "modified": "2025-02-21 07:11:33.068648", "modified_by": "Administrator", "module": null, "name": "Lead-city-print_hide", @@ -3021,7 +3085,7 @@ "field_name": "company_name", "idx": 0, "is_system_generated": 1, - "modified": "2024-12-24 15:00:55.149558", + "modified": "2025-02-21 07:11:33.084429", "modified_by": "Administrator", "module": null, "name": "Lead-company_name-in_list_view", @@ -3044,7 +3108,7 @@ "field_name": "company_name", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.166176", + "modified": "2025-02-21 07:11:33.098723", "modified_by": "Administrator", "module": null, "name": "Lead-company_name-print_hide", @@ -3067,7 +3131,7 @@ "field_name": "company", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.181213", + "modified": "2025-02-21 07:11:33.113627", "modified_by": "Administrator", "module": null, "name": "Lead-company-print_hide", @@ -3090,7 +3154,7 @@ "field_name": "contact_html", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.196702", + "modified": "2025-02-21 07:11:33.128109", "modified_by": "Administrator", "module": null, "name": "Lead-contact_html-print_hide", @@ -3113,7 +3177,7 @@ "field_name": "contact_info_tab", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.211731", + "modified": "2025-02-21 07:11:33.142991", "modified_by": "Administrator", "module": null, "name": "Lead-contact_info_tab-print_hide", @@ -3136,7 +3200,7 @@ "field_name": "country", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-31 08:50:15.148950", + "modified": "2025-02-21 07:11:33.157715", "modified_by": "Administrator", "module": null, "name": "Lead-country-label", @@ -3159,7 +3223,7 @@ "field_name": "country", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.227092", + "modified": "2025-02-21 07:11:33.172781", "modified_by": "Administrator", "module": null, "name": "Lead-country-reqd", @@ -3182,7 +3246,7 @@ "field_name": "custom_status", "idx": 0, "is_system_generated": 1, - "modified": "2024-12-24 15:00:55.241730", + "modified": "2025-02-21 07:11:33.187352", "modified_by": "Administrator", "module": null, "name": "Lead-custom_status-in_list_view", @@ -3205,7 +3269,7 @@ "field_name": "customer", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.256705", + "modified": "2025-02-21 07:11:33.203026", "modified_by": "Administrator", "module": null, "name": "Lead-customer-print_hide", @@ -3228,7 +3292,7 @@ "field_name": "dashboard_tab", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.271036", + "modified": "2025-02-21 07:11:33.220675", "modified_by": "Administrator", "module": null, "name": "Lead-dashboard_tab-print_hide", @@ -3251,7 +3315,7 @@ "field_name": "disabled", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.285582", + "modified": "2025-02-21 07:11:33.235371", "modified_by": "Administrator", "module": null, "name": "Lead-disabled-print_hide", @@ -3274,7 +3338,7 @@ "field_name": "fax", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.300071", + "modified": "2025-02-21 07:11:33.250166", "modified_by": "Administrator", "module": null, "name": "Lead-fax-print_hide", @@ -3297,7 +3361,7 @@ "field_name": "gender", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.315884", + "modified": "2025-02-21 07:11:33.264777", "modified_by": "Administrator", "module": null, "name": "Lead-gender-reqd", @@ -3320,7 +3384,7 @@ "field_name": "industry", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.330687", + "modified": "2025-02-21 07:11:33.279416", "modified_by": "Administrator", "module": null, "name": "Lead-industry-print_hide", @@ -3343,7 +3407,7 @@ "field_name": "job_title", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.345752", + "modified": "2025-02-21 07:11:33.293774", "modified_by": "Administrator", "module": null, "name": "Lead-job_title-hidden", @@ -3366,7 +3430,7 @@ "field_name": "job_title", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.360456", + "modified": "2025-02-21 07:11:33.308217", "modified_by": "Administrator", "module": null, "name": "Lead-job_title-in_list_view", @@ -3389,7 +3453,7 @@ "field_name": "job_title", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.375385", + "modified": "2025-02-21 07:11:33.322744", "modified_by": "Administrator", "module": null, "name": "Lead-job_title-in_standard_filter", @@ -3412,7 +3476,7 @@ "field_name": "job_title", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.390525", + "modified": "2025-02-21 07:11:33.337252", "modified_by": "Administrator", "module": null, "name": "Lead-job_title-print_hide", @@ -3435,7 +3499,7 @@ "field_name": "language", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.404930", + "modified": "2025-02-21 07:11:33.351351", "modified_by": "Administrator", "module": null, "name": "Lead-language-print_hide", @@ -3458,7 +3522,7 @@ "field_name": "last_name", "idx": 0, "is_system_generated": 1, - "modified": "2024-12-24 15:00:55.419966", + "modified": "2025-02-21 07:11:33.365680", "modified_by": "Administrator", "module": null, "name": "Lead-last_name-in_list_view", @@ -3481,7 +3545,7 @@ "field_name": "lead_name", "idx": 0, "is_system_generated": 1, - "modified": "2024-12-24 15:00:55.434202", + "modified": "2025-02-21 07:11:33.380539", "modified_by": "Administrator", "module": null, "name": "Lead-lead_name-in_list_view", @@ -3504,7 +3568,7 @@ "field_name": "lead_name", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.448611", + "modified": "2025-02-21 07:11:33.394860", "modified_by": "Administrator", "module": null, "name": "Lead-lead_name-print_hide", @@ -3527,7 +3591,7 @@ "field_name": "lead_owner", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.463198", + "modified": "2025-02-21 07:11:33.408929", "modified_by": "Administrator", "module": null, "name": "Lead-lead_owner-print_hide", @@ -3542,7 +3606,7 @@ "_comments": null, "_liked_by": null, "_user_tags": null, - "creation": "2024-12-24 15:00:58.677316", + "creation": "2025-02-21 07:11:36.893148", "default_value": null, "doc_type": "Lead", "docstatus": 0, @@ -3550,7 +3614,7 @@ "field_name": null, "idx": 0, "is_system_generated": 1, - "modified": "2024-12-24 15:00:58.677316", + "modified": "2025-02-21 07:11:36.893148", "modified_by": "Administrator", "module": null, "name": "Lead-main-default_print_format", @@ -3565,7 +3629,7 @@ "_comments": null, "_liked_by": null, "_user_tags": null, - "creation": "2024-12-31 08:48:09.343782", + "creation": "2025-02-21 08:05:09.632034", "default_value": null, "doc_type": "Lead", "docstatus": 0, @@ -3573,7 +3637,7 @@ "field_name": null, "idx": 0, "is_system_generated": 0, - "modified": "2024-12-31 08:48:09.343782", + "modified": "2025-02-21 08:05:09.632034", "modified_by": "Administrator", "module": null, "name": "Lead-main-field_order", @@ -3581,14 +3645,14 @@ "property": "field_order", "property_type": "Data", "row_name": null, - "value": "[\"custom_details\", \"naming_series\", \"first_name\", \"middle_name\", \"last_name\", \"salutation\", \"custom_new_national_id\", \"custom_how_did_you_hear_about_us\", \"custom_consultation_location_preference\", \"custom_creation\", \"custom_dob\", \"custom_is_relative\", \"custom_contact_relative\", \"custom_relative_first_name\", \"custom_relative_last_name\", \"custom_relative_gender\", \"custom_relative_salutation\", \"custom_relative_email_id\", \"custom_relative_phone\", \"custom_relative_country\", \"custom_relation\", \"column_break_1\", \"lead_name\", \"job_title\", \"gender\", \"source\", \"custom_occupation\", \"custom_marital_status\", \"custom_children\", \"custom_number_of_children\", \"custom_pets\", \"col_break123\", \"lead_owner\", \"status\", \"custom_status\", \"customer\", \"custom_lead_type\", \"custom_request_type\", \"type\", \"request_type\", \"custom_gesy\", \"contact_info_tab\", \"custom_national_id\", \"email_id\", \"website\", \"column_break_20\", \"mobile_no\", \"whatsapp_no\", \"column_break_16\", \"phone\", \"phone_ext\", \"organization_section\", \"company_name\", \"no_of_employees\", \"column_break_28\", \"annual_revenue\", \"industry\", \"market_segment\", \"column_break_31\", \"territory\", \"fax\", \"address_section\", \"custom_customer_primary_address\", \"address_html\", \"column_break_38\", \"custom_preferred_communication\", \"custom_street_name\", \"custom_building_name\", \"custom_post_code\", \"city\", \"state\", \"country\", \"column_break2\", \"contact_html\", \"qualification_tab\", \"qualification_status\", \"column_break_64\", \"qualified_by\", \"qualified_on\", \"other_info_tab\", \"campaign_name\", \"company\", \"column_break_22\", \"language\", \"image\", \"title\", \"column_break_50\", \"disabled\", \"unsubscribed\", \"blog_subscriber\", \"custom_classification\", \"custom_classification_type\", \"activities_tab\", \"open_activities_html\", \"all_activities_section\", \"all_activities_html\", \"notes_tab\", \"notes_html\", \"notes\", \"dashboard_tab\", \"custom_sales_team_tab\", \"custom_sales_partner\", \"custom_referral_code\", \"custom_column_break_95uom\", \"custom_commission_rate\", \"custom_history_tab\", \"custom_medical_history\", \"custom_dental_history\", \"custom_stress_identification\", \"custom_customer_consent\"]" + "value": "[\"custom_details\", \"naming_series\", \"first_name\", \"middle_name\", \"last_name\", \"salutation\", \"custom_new_national_id\", \"custom_how_did_you_hear_about_us\", \"custom_consultation_location_preference\", \"custom_creation\", \"custom_dob\", \"custom_is_relative\", \"custom_contact_relative\", \"custom_relative_first_name\", \"custom_relative_last_name\", \"custom_relative_gender\", \"custom_relative_salutation\", \"custom_relative_email_id\", \"custom_relative_phone\", \"custom_relative_country\", \"custom_relation\", \"column_break_1\", \"lead_name\", \"job_title\", \"gender\", \"source\", \"custom_occupation\", \"custom_marital_status\", \"custom_children\", \"custom_number_of_children\", \"custom_pets\", \"col_break123\", \"lead_owner\", \"status\", \"custom_status\", \"customer\", \"custom_lead_type\", \"custom_request_type\", \"type\", \"request_type\", \"custom_gesy\", \"contact_info_tab\", \"custom_national_id\", \"email_id\", \"website\", \"column_break_20\", \"mobile_no\", \"whatsapp_no\", \"column_break_16\", \"phone\", \"phone_ext\", \"organization_section\", \"company_name\", \"no_of_employees\", \"column_break_28\", \"annual_revenue\", \"industry\", \"market_segment\", \"column_break_31\", \"territory\", \"fax\", \"address_section\", \"custom_customer_primary_address\", \"address_html\", \"column_break_38\", \"custom_preferred_communication\", \"custom_street_name\", \"custom_building_name\", \"custom_post_code\", \"city\", \"state\", \"country\", \"column_break2\", \"contact_html\", \"qualification_tab\", \"qualification_status\", \"column_break_64\", \"qualified_by\", \"qualified_on\", \"other_info_tab\", \"campaign_name\", \"company\", \"column_break_22\", \"language\", \"image\", \"title\", \"column_break_50\", \"disabled\", \"unsubscribed\", \"blog_subscriber\", \"custom_classification\", \"custom_classification_type\", \"activities_tab\", \"open_activities_html\", \"all_activities_section\", \"all_activities_html\", \"notes_tab\", \"notes_html\", \"notes\", \"dashboard_tab\", \"custom_sales_team_tab\", \"custom_sales_partner\", \"custom_referral_code\", \"custom_column_break_95uom\", \"custom_commission_rate\", \"custom_history_tab\", \"custom_medical_history\", \"custom_dental_history\", \"custom_stress_identification\", \"longevity_history\", \"custom_customer_consent\"]" }, { "_assign": null, "_comments": null, "_liked_by": null, "_user_tags": null, - "creation": "2024-12-31 08:50:15.215071", + "creation": "2025-02-21 08:05:09.770340", "default_value": null, "doc_type": "Lead", "docstatus": 0, @@ -3596,7 +3660,7 @@ "field_name": null, "idx": 0, "is_system_generated": 0, - "modified": "2024-12-31 08:50:15.215071", + "modified": "2025-02-21 08:05:09.770340", "modified_by": "Administrator", "module": null, "name": "Lead-main-links_order", @@ -3619,7 +3683,7 @@ "field_name": null, "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.522038", + "modified": "2025-02-21 07:11:33.468107", "modified_by": "Administrator", "module": null, "name": "Lead-main-search_fields", @@ -3642,7 +3706,7 @@ "field_name": "market_segment", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.536468", + "modified": "2025-02-21 07:11:33.482775", "modified_by": "Administrator", "module": null, "name": "Lead-market_segment-print_hide", @@ -3665,7 +3729,7 @@ "field_name": "middle_name", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.550874", + "modified": "2025-02-21 07:11:33.497295", "modified_by": "Administrator", "module": null, "name": "Lead-middle_name-hidden", @@ -3688,7 +3752,7 @@ "field_name": "middle_name", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.565738", + "modified": "2025-02-21 07:11:33.511809", "modified_by": "Administrator", "module": null, "name": "Lead-middle_name-print_hide", @@ -3698,6 +3762,29 @@ "row_name": null, "value": "1" }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "creation": "2025-02-19 10:01:36.011516", + "default_value": null, + "doc_type": "Lead", + "docstatus": 0, + "doctype_or_field": "DocField", + "field_name": "naming_series", + "idx": 0, + "is_system_generated": 0, + "modified": "2025-02-19 10:01:36.011516", + "modified_by": "Administrator", + "module": null, + "name": "Lead-naming_series-options", + "owner": "Administrator", + "property": "options", + "property_type": "Text", + "row_name": null, + "value": "CRM-LEAD-.YYYY.-" + }, { "_assign": null, "_comments": null, @@ -3711,7 +3798,7 @@ "field_name": "naming_series", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.580066", + "modified": "2025-02-21 07:11:33.526159", "modified_by": "Administrator", "module": null, "name": "Lead-naming_series-print_hide", @@ -3734,7 +3821,7 @@ "field_name": "no_of_employees", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.594989", + "modified": "2025-02-21 07:11:33.540824", "modified_by": "Administrator", "module": null, "name": "Lead-no_of_employees-print_hide", @@ -3757,7 +3844,7 @@ "field_name": "notes_html", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.609549", + "modified": "2025-02-21 07:11:33.555618", "modified_by": "Administrator", "module": null, "name": "Lead-notes_html-print_hide", @@ -3780,7 +3867,7 @@ "field_name": "notes_tab", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.624059", + "modified": "2025-02-21 07:11:33.570139", "modified_by": "Administrator", "module": null, "name": "Lead-notes_tab-print_hide", @@ -3803,7 +3890,7 @@ "field_name": "notes", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.638387", + "modified": "2025-02-21 07:11:33.584703", "modified_by": "Administrator", "module": null, "name": "Lead-notes-print_hide", @@ -3826,7 +3913,7 @@ "field_name": "open_activities_html", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.652559", + "modified": "2025-02-21 07:11:33.599330", "modified_by": "Administrator", "module": null, "name": "Lead-open_activities_html-default", @@ -3849,7 +3936,7 @@ "field_name": "open_activities_html", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.673164", + "modified": "2025-02-21 07:11:33.614135", "modified_by": "Administrator", "module": null, "name": "Lead-open_activities_html-print_hide", @@ -3872,7 +3959,7 @@ "field_name": "organization_section", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.687599", + "modified": "2025-02-21 07:11:33.628303", "modified_by": "Administrator", "module": null, "name": "Lead-organization_section-hidden", @@ -3895,7 +3982,7 @@ "field_name": "organization_section", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.702881", + "modified": "2025-02-21 07:11:33.643703", "modified_by": "Administrator", "module": null, "name": "Lead-organization_section-print_hide", @@ -3918,7 +4005,7 @@ "field_name": "other_info_tab", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.717895", + "modified": "2025-02-21 07:11:33.658294", "modified_by": "Administrator", "module": null, "name": "Lead-other_info_tab-print_hide", @@ -3941,7 +4028,7 @@ "field_name": "phone_ext", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.732671", + "modified": "2025-02-21 07:11:33.672584", "modified_by": "Administrator", "module": null, "name": "Lead-phone_ext-print_hide", @@ -3964,7 +4051,7 @@ "field_name": "qualification_status", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.747607", + "modified": "2025-02-21 07:11:33.687250", "modified_by": "Administrator", "module": null, "name": "Lead-qualification_status-print_hide", @@ -3987,7 +4074,7 @@ "field_name": "qualification_tab", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.763629", + "modified": "2025-02-21 07:11:33.701693", "modified_by": "Administrator", "module": null, "name": "Lead-qualification_tab-print_hide", @@ -4010,7 +4097,7 @@ "field_name": "qualified_by", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.778341", + "modified": "2025-02-21 07:11:33.716560", "modified_by": "Administrator", "module": null, "name": "Lead-qualified_by-print_hide", @@ -4033,7 +4120,7 @@ "field_name": "qualified_on", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.792844", + "modified": "2025-02-21 07:11:33.732234", "modified_by": "Administrator", "module": null, "name": "Lead-qualified_on-print_hide", @@ -4056,7 +4143,7 @@ "field_name": "request_type", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.807212", + "modified": "2025-02-21 07:11:33.748331", "modified_by": "Administrator", "module": null, "name": "Lead-request_type-hidden", @@ -4079,7 +4166,7 @@ "field_name": "request_type", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.823305", + "modified": "2025-02-21 07:11:33.763922", "modified_by": "Administrator", "module": null, "name": "Lead-request_type-print_hide", @@ -4102,7 +4189,7 @@ "field_name": "salutation", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-31 08:47:32.554575", + "modified": "2025-02-21 07:11:33.779484", "modified_by": "Administrator", "module": null, "name": "Lead-salutation-label", @@ -4125,7 +4212,7 @@ "field_name": "source", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.838346", + "modified": "2025-02-21 07:11:33.796004", "modified_by": "Administrator", "module": null, "name": "Lead-source-print_hide", @@ -4148,7 +4235,7 @@ "field_name": "state", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.852740", + "modified": "2025-02-21 07:11:33.810452", "modified_by": "Administrator", "module": null, "name": "Lead-state-hidden", @@ -4171,7 +4258,7 @@ "field_name": "state", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.867070", + "modified": "2025-02-21 07:11:33.824866", "modified_by": "Administrator", "module": null, "name": "Lead-state-print_hide", @@ -4194,7 +4281,7 @@ "field_name": "status", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.881641", + "modified": "2025-02-21 07:11:33.839637", "modified_by": "Administrator", "module": null, "name": "Lead-status-hidden", @@ -4217,7 +4304,7 @@ "field_name": "status", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.895953", + "modified": "2025-02-21 07:11:33.854596", "modified_by": "Administrator", "module": null, "name": "Lead-status-in_list_view", @@ -4240,7 +4327,7 @@ "field_name": "status", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.910399", + "modified": "2025-02-21 07:11:33.869172", "modified_by": "Administrator", "module": null, "name": "Lead-status-in_standard_filter", @@ -4263,7 +4350,7 @@ "field_name": "status", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.924912", + "modified": "2025-02-21 07:11:33.883668", "modified_by": "Administrator", "module": null, "name": "Lead-status-print_hide", @@ -4286,7 +4373,7 @@ "field_name": "territory", "idx": 0, "is_system_generated": 1, - "modified": "2024-12-24 15:00:55.939523", + "modified": "2025-02-21 07:11:33.898709", "modified_by": "Administrator", "module": null, "name": "Lead-territory-in_list_view", @@ -4309,7 +4396,7 @@ "field_name": "title", "idx": 0, "is_system_generated": 1, - "modified": "2024-12-24 15:00:55.953950", + "modified": "2025-02-21 07:11:33.913734", "modified_by": "Administrator", "module": null, "name": "Lead-title-in_list_view", @@ -4332,7 +4419,7 @@ "field_name": "type", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.968576", + "modified": "2025-02-21 07:11:33.928095", "modified_by": "Administrator", "module": null, "name": "Lead-type-hidden", @@ -4355,7 +4442,7 @@ "field_name": "type", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.983033", + "modified": "2025-02-21 07:11:33.942654", "modified_by": "Administrator", "module": null, "name": "Lead-type-print_hide", @@ -4378,7 +4465,7 @@ "field_name": "unsubscribed", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:55.997273", + "modified": "2025-02-21 07:11:33.958349", "modified_by": "Administrator", "module": null, "name": "Lead-unsubscribed-print_hide", @@ -4401,7 +4488,7 @@ "field_name": "website", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:56.011097", + "modified": "2025-02-21 07:11:33.973118", "modified_by": "Administrator", "module": null, "name": "Lead-website-print_hide", @@ -4424,7 +4511,7 @@ "field_name": "whatsapp_no", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-24 15:00:56.025682", + "modified": "2025-02-21 07:11:33.987468", "modified_by": "Administrator", "module": null, "name": "Lead-whatsapp_no-print_hide", diff --git a/swissmedhealth/swissmedhealth/custom/patient.json b/swissmedhealth/swissmedhealth/custom/patient.json index 7f8c11f..149f12c 100644 --- a/swissmedhealth/swissmedhealth/custom/patient.json +++ b/swissmedhealth/swissmedhealth/custom/patient.json @@ -224,7 +224,7 @@ "in_list_view": 0, "in_preview": 0, "in_standard_filter": 0, - "insert_after": "custom_stress_identification", + "insert_after": "custom_longevity_history", "is_system_generated": 0, "is_virtual": 0, "label": "Customer Consent", @@ -576,6 +576,70 @@ "unique": 0, "width": null }, + { + "_assign": null, + "_comments": null, + "_liked_by": null, + "_user_tags": null, + "allow_in_quick_entry": 0, + "allow_on_submit": 0, + "bold": 0, + "collapsible": 0, + "collapsible_depends_on": null, + "columns": 0, + "creation": "2025-02-21 08:06:31.592366", + "default": null, + "depends_on": null, + "description": null, + "docstatus": 0, + "dt": "Patient", + "fetch_from": null, + "fetch_if_empty": 0, + "fieldname": "custom_longevity_history", + "fieldtype": "Link", + "hidden": 0, + "hide_border": 0, + "hide_days": 0, + "hide_seconds": 0, + "idx": 76, + "ignore_user_permissions": 0, + "ignore_xss_filter": 0, + "in_global_search": 0, + "in_list_view": 0, + "in_preview": 0, + "in_standard_filter": 0, + "insert_after": "custom_stress_identification", + "is_system_generated": 0, + "is_virtual": 0, + "label": "Longevity History", + "length": 0, + "link_filters": null, + "mandatory_depends_on": null, + "modified": "2025-02-21 08:07:10.104925", + "modified_by": "Administrator", + "module": "Swissmedhealth", + "name": "Patient-custom_longevity_history", + "no_copy": 0, + "non_negative": 0, + "options": "Longevity History", + "owner": "Administrator", + "permlevel": 0, + "placeholder": null, + "precision": "", + "print_hide": 1, + "print_hide_if_no_value": 0, + "print_width": null, + "read_only": 1, + "read_only_depends_on": null, + "report_hide": 0, + "reqd": 0, + "search_index": 0, + "show_dashboard": 0, + "sort_options": 0, + "translatable": 0, + "unique": 0, + "width": null + }, { "_assign": null, "_comments": null, @@ -1170,7 +1234,7 @@ "field_name": "address_contacts", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-10 14:19:26.394785", + "modified": "2025-02-21 07:11:34.612321", "modified_by": "Administrator", "module": null, "name": "Patient-address_contacts-depends_on", @@ -1193,7 +1257,7 @@ "field_name": "blood_group", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-10 14:19:26.401898", + "modified": "2025-02-21 07:11:34.627821", "modified_by": "Administrator", "module": null, "name": "Patient-blood_group-hidden", @@ -1216,7 +1280,7 @@ "field_name": "invite_user", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-10 14:19:26.409032", + "modified": "2025-02-21 07:11:34.644561", "modified_by": "Administrator", "module": null, "name": "Patient-invite_user-default", @@ -1231,7 +1295,7 @@ "_comments": null, "_liked_by": null, "_user_tags": null, - "creation": "2024-12-10 15:24:05.581169", + "creation": "2025-02-21 08:06:31.486536", "default_value": null, "doc_type": "Patient", "docstatus": 0, @@ -1239,7 +1303,7 @@ "field_name": null, "idx": 0, "is_system_generated": 0, - "modified": "2024-12-10 15:24:05.581169", + "modified": "2025-02-21 08:06:31.486536", "modified_by": "Administrator", "module": null, "name": "Patient-main-field_order", @@ -1247,7 +1311,7 @@ "property": "field_order", "property_type": "Data", "row_name": null, - "value": "[\"basic_info\", \"naming_series\", \"first_name\", \"middle_name\", \"last_name\", \"patient_name\", \"sex\", \"blood_group\", \"dob\", \"custom_national_id\", \"custom_occupation\", \"age_html\", \"image\", \"column_break_14\", \"status\", \"uid\", \"inpatient_record\", \"inpatient_status\", \"report_preference\", \"mobile\", \"phone\", \"email\", \"invite_user\", \"user_id\", \"custom_categories\", \"custom_source\", \"custom_gesy\", \"custom_column_break_hjtih\", \"custom_plan_type\", \"custom_column_break_2w2hc\", \"custom_purpose\", \"custom_diagnostics\", \"custom_treatments\", \"custom_longevity_program\", \"customer_details_section\", \"custom_lead_name\", \"customer\", \"customer_group\", \"territory\", \"column_break_24\", \"default_currency\", \"default_price_list\", \"language\", \"more_info\", \"patient_details\", \"dashboard_tab\", \"address_and_contact_tab\", \"address_contacts\", \"address_html\", \"column_break_22\", \"contact_html\", \"sb_relation\", \"patient_relation\", \"medical_history_tab\", \"personal_and_social_history\", \"occupation\", \"column_break_25\", \"marital_status\", \"allergy_medical_and_surgical_history\", \"allergies\", \"medication\", \"column_break_20\", \"medical_history\", \"surgical_history\", \"risk_factors\", \"tobacco_past_use\", \"tobacco_current_use\", \"alcohol_past_use\", \"alcohol_current_use\", \"column_break_32\", \"surrounding_factors\", \"other_risk_factors\", \"custom_history_tab\", \"custom_medical_history\", \"custom_dental_history\", \"custom_stress_identification\", \"custom_customer_consent\"]" + "value": "[\"basic_info\", \"naming_series\", \"first_name\", \"middle_name\", \"last_name\", \"patient_name\", \"sex\", \"blood_group\", \"dob\", \"custom_national_id\", \"custom_occupation\", \"age_html\", \"image\", \"column_break_14\", \"status\", \"uid\", \"inpatient_record\", \"inpatient_status\", \"report_preference\", \"mobile\", \"phone\", \"email\", \"invite_user\", \"user_id\", \"custom_categories\", \"custom_source\", \"custom_gesy\", \"custom_column_break_hjtih\", \"custom_plan_type\", \"custom_column_break_2w2hc\", \"custom_purpose\", \"custom_diagnostics\", \"custom_treatments\", \"custom_longevity_program\", \"customer_details_section\", \"custom_lead_name\", \"customer\", \"customer_group\", \"territory\", \"column_break_24\", \"default_currency\", \"default_price_list\", \"language\", \"more_info\", \"patient_details\", \"dashboard_tab\", \"address_and_contact_tab\", \"address_contacts\", \"address_html\", \"column_break_22\", \"contact_html\", \"sb_relation\", \"patient_relation\", \"medical_history_tab\", \"personal_and_social_history\", \"occupation\", \"column_break_25\", \"marital_status\", \"allergy_medical_and_surgical_history\", \"allergies\", \"medication\", \"column_break_20\", \"medical_history\", \"surgical_history\", \"risk_factors\", \"tobacco_past_use\", \"tobacco_current_use\", \"alcohol_past_use\", \"alcohol_current_use\", \"column_break_32\", \"surrounding_factors\", \"other_risk_factors\", \"custom_history_tab\", \"custom_medical_history\", \"custom_dental_history\", \"custom_stress_identification\", \"longevity_history\", \"custom_customer_consent\"]" }, { "_assign": null, @@ -1262,7 +1326,7 @@ "field_name": null, "idx": 0, "is_system_generated": 0, - "modified": "2024-12-10 14:19:26.422986", + "modified": "2025-02-21 07:11:34.675483", "modified_by": "Administrator", "module": null, "name": "Patient-main-quick_entry", @@ -1285,7 +1349,7 @@ "field_name": "medical_history_tab", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-10 14:19:26.429684", + "modified": "2025-02-21 07:11:34.689720", "modified_by": "Administrator", "module": null, "name": "Patient-medical_history_tab-hidden", @@ -1308,7 +1372,7 @@ "field_name": "middle_name", "idx": 0, "is_system_generated": 0, - "modified": "2024-12-10 14:19:26.438610", + "modified": "2025-02-21 07:11:34.704134", "modified_by": "Administrator", "module": null, "name": "Patient-middle_name-hidden", diff --git a/swissmedhealth/swissmedhealth/doctype/longevity_history/__init__.py b/swissmedhealth/swissmedhealth/doctype/longevity_history/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.js b/swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.js new file mode 100644 index 0000000..62d5b51 --- /dev/null +++ b/swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.js @@ -0,0 +1,8 @@ +// Copyright (c) 2025, KAINOTOMO PH LTD and contributors +// For license information, please see license.txt + +// frappe.ui.form.on("Longevity History", { +// refresh(frm) { + +// }, +// }); diff --git a/swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.json b/swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.json new file mode 100644 index 0000000..4cccef9 --- /dev/null +++ b/swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.json @@ -0,0 +1,964 @@ +{ + "actions": [], + "allow_rename": 1, + "autoname": "naming_series:", + "creation": "2025-02-21 07:17:16.597139", + "doctype": "DocType", + "engine": "InnoDB", + "field_order": [ + "heading_1", + "naming_series", + "goals_heading", + "increase_energy_levels", + "improve_cognitive_function", + "enhance_physical_performance_and_mobility", + "slow_down_biological_aging", + "improve_sleep_quality", + "reduce_inflammation_and_oxidative_stress", + "prevent_age_related_diseases", + "reduce_stress", + "goals_other", + "track_heading", + "track_yes", + "track_desc", + "track_no", + "tests_heading", + "dna_methylation_test", + "biological_age_test", + "hormone_panel", + "advanced_lipid_panel", + "inflammation_markers", + "insulin_sensitivity_test", + "gut_microbiome_analysis", + "mitochondrial_function_test", + "heavy_metal_test", + "tests_other", + "habits_section", + "diet_heading", + "mediterranean_diet", + "ketogenic_low_carb_diet", + "intermittent_fasting_or_time_restricted_eating", + "plant_based_diet", + "diet_other", + "fast_heading", + "less_than_10_hours", + "10_12_hours", + "12_16_hours", + "more_than_16_hours", + "protein_heading", + "less_than_5_hours", + "5_6_hours", + "7_8_hours", + "more_than_8_hours", + "sleep_heading", + "very_bad_i_wake_up_every_2_3_hours", + "bad_i_wake_up_1_2_times_per_night", + "ok", + "good", + "morning_heading", + "morning_yes", + "morning_no", + "sleep_optimize_heading", + "blue_light_blocking_glasses", + "meditation_or_relaxation_techniques", + "sleep_supplements", + "cold_exposure_before_bed", + "sleep_optimize_other", + "exercise_heading", + "resistance_training", + "cardiovascular_training", + "body_posture_optimisation", + "high_intensity_interval_training", + "yoga_pilates", + "exercise_other", + "medical_metabolic_health_section", + "metaboli_history_heading", + "cardiovascular_disease", + "diabetes_or_insulin_resistance", + "neurodegenerative_conditions", + "osteoporosis_or_osteopenia", + "autoimmune_disorders", + "cancer", + "hormonal_imbalances", + "chronic_inflammation_or_metabolic_dysfunction", + "metaboli_history_other", + "supplements_heading", + "nad_precursors", + "metformin_or_berberine", + "rapamycin", + "resveratrol_quercetin", + "collagen_or_hyaluronic_acid", + "omega_3", + "supplements_other", + "therapies_heading", + "hyperbaric_oxygen_therapy", + "ozone_therapy", + "peptide_therapy", + "stem_cell_therapy", + "cryotherapy_or_cold_exposure_therapy", + "therapies_other", + "monitor_heading", + "blood_glucose_levels", + "heart_rate_variability", + "sleep_quality", + "body_composition", + "monitor_other", + "well_being_section", + "how_would_you_describe_your_stress_levels", + "low", + "moderate", + "high", + "how_do_you_manage_stress", + "meditation_or_mindfulness_practices", + "breathing_exercises", + "regular_exercise", + "social_engagement_and_relationships", + "professional_therapy_or_coaching", + "stress_other", + "emotiona_well_being_section", + "emotional_well_being_heading", + "emotionally_balanced", + "occasionally_stressed", + "frequently_overwhelmed", + "struggling_emotionally", + "seeking_support", + "social_well_being_section", + "how_would_you_describe_your_social_connections", + "i_have_strong_and_meaningful_relationships", + "social_connection_check", + "i_often_feel_socially_isolated_or_disconnected", + "environmental_toxin_exposure_section", + "toxins_heading", + "mercury", + "lead", + "mold_toxicity", + "toxins_other", + "toxin_measure_section", + "air_purification_at_home", + "filtered_water", + "organic_diet", + "regular_sauna_use_for_detoxification", + "toxin_measure_other" + ], + "fields": [ + { + "fieldname": "heading_1", + "fieldtype": "Section Break", + "label": "Longevity & Health Goals" + }, + { + "fieldname": "naming_series", + "fieldtype": "Select", + "hidden": 1, + "label": "Series", + "options": "LON-HIS-.YYYY.-", + "print_hide": 1 + }, + { + "default": "0", + "fieldname": "increase_energy_levels", + "fieldtype": "Check", + "label": "Increase energy levels" + }, + { + "default": "0", + "fieldname": "improve_cognitive_function", + "fieldtype": "Check", + "label": "Improve cognitive function" + }, + { + "default": "0", + "fieldname": "enhance_physical_performance_and_mobility", + "fieldtype": "Check", + "label": "Enhance physical performance and mobility" + }, + { + "default": "0", + "fieldname": "slow_down_biological_aging", + "fieldtype": "Check", + "label": "Slow down biological aging" + }, + { + "default": "0", + "fieldname": "improve_sleep_quality", + "fieldtype": "Check", + "label": "Improve sleep quality" + }, + { + "default": "0", + "fieldname": "reduce_inflammation_and_oxidative_stress", + "fieldtype": "Check", + "label": "Reduce inflammation and oxidative stress" + }, + { + "default": "0", + "fieldname": "prevent_age_related_diseases", + "fieldtype": "Check", + "label": "Prevent age-related diseases" + }, + { + "default": "0", + "fieldname": "reduce_stress", + "fieldtype": "Check", + "label": "Reduce stress" + }, + { + "fieldname": "goals_other", + "fieldtype": "Small Text", + "label": "Other" + }, + { + "description": "Check all that apply", + "fieldname": "goals_heading", + "fieldtype": "Heading", + "label": "What are your main longevity-related concerns or goals?" + }, + { + "fieldname": "track_heading", + "fieldtype": "Heading", + "label": "Do you track your biological age or metabolic age?" + }, + { + "depends_on": "eval:doc.track_yes==1;", + "fieldname": "track_desc", + "fieldtype": "Small Text", + "label": "Please provide the latest result" + }, + { + "description": "Check all that apply", + "fieldname": "tests_heading", + "fieldtype": "Heading", + "label": "Have you done any of the following longevity-related tests?" + }, + { + "default": "0", + "fieldname": "dna_methylation_test", + "fieldtype": "Check", + "label": "DNA methylation test" + }, + { + "default": "0", + "fieldname": "biological_age_test", + "fieldtype": "Check", + "label": "Biological Age Test" + }, + { + "default": "0", + "description": "(DHEA, testosterone, estrogen, cortisol, etc.)", + "fieldname": "hormone_panel", + "fieldtype": "Check", + "label": "Hormone panel" + }, + { + "default": "0", + "description": "(LDL particle size, APOB, etc.)", + "fieldname": "advanced_lipid_panel", + "fieldtype": "Check", + "label": "Advanced lipid panel" + }, + { + "default": "0", + "description": "(CRP, homocysteine)", + "fieldname": "inflammation_markers", + "fieldtype": "Check", + "label": "Inflammation markers" + }, + { + "default": "0", + "description": "(fasting insulin, HOMA-IR)", + "fieldname": "insulin_sensitivity_test", + "fieldtype": "Check", + "label": "Insulin sensitivity test" + }, + { + "default": "0", + "fieldname": "gut_microbiome_analysis", + "fieldtype": "Check", + "label": "Gut microbiome analysis" + }, + { + "default": "0", + "fieldname": "mitochondrial_function_test", + "fieldtype": "Check", + "label": "Mitochondrial function test" + }, + { + "default": "0", + "fieldname": "heavy_metal_test", + "fieldtype": "Check", + "label": "Heavy metal test" + }, + { + "fieldname": "tests_other", + "fieldtype": "Small Text", + "label": "Other" + }, + { + "fieldname": "habits_section", + "fieldtype": "Section Break", + "label": "Lifestyle & Daily Habits" + }, + { + "fieldname": "diet_heading", + "fieldtype": "Heading", + "label": "Do you follow a specific longevity-based diet?" + }, + { + "default": "0", + "fieldname": "mediterranean_diet", + "fieldtype": "Check", + "label": "Mediterranean diet" + }, + { + "default": "0", + "fieldname": "ketogenic_low_carb_diet", + "fieldtype": "Check", + "label": "Ketogenic/Low-carb diet" + }, + { + "default": "0", + "fieldname": "intermittent_fasting_or_time_restricted_eating", + "fieldtype": "Check", + "label": "Intermittent fasting or time-restricted eating" + }, + { + "default": "0", + "fieldname": "plant_based_diet", + "fieldtype": "Check", + "label": "Plant-based diet" + }, + { + "fieldname": "diet_other", + "fieldtype": "Small Text", + "label": "Other" + }, + { + "default": "0", + "fieldname": "track_yes", + "fieldtype": "Check", + "label": "Yes" + }, + { + "default": "0", + "fieldname": "track_no", + "fieldtype": "Check", + "label": "No" + }, + { + "fieldname": "fast_heading", + "fieldtype": "Heading", + "label": "How many hours do you fast daily" + }, + { + "default": "0", + "fieldname": "less_than_10_hours", + "fieldtype": "Check", + "label": "Less than 10 hours" + }, + { + "default": "0", + "fieldname": "10_12_hours", + "fieldtype": "Check", + "label": "10-12 hours" + }, + { + "default": "0", + "fieldname": "12_16_hours", + "fieldtype": "Check", + "label": "12-16 hours" + }, + { + "default": "0", + "fieldname": "more_than_16_hours", + "fieldtype": "Check", + "label": "More than 16 hours" + }, + { + "fieldname": "protein_heading", + "fieldtype": "Heading", + "label": "What are your main sources of protein?" + }, + { + "default": "0", + "fieldname": "less_than_5_hours", + "fieldtype": "Check", + "label": "Less than 5 hours" + }, + { + "default": "0", + "fieldname": "5_6_hours", + "fieldtype": "Check", + "label": "5-6 hours" + }, + { + "default": "0", + "fieldname": "7_8_hours", + "fieldtype": "Check", + "label": "7-8 hours" + }, + { + "default": "0", + "fieldname": "more_than_8_hours", + "fieldtype": "Check", + "label": "More than 8 hours" + }, + { + "fieldname": "sleep_heading", + "fieldtype": "Heading", + "label": "How is your sleep quality?" + }, + { + "default": "0", + "fieldname": "very_bad_i_wake_up_every_2_3_hours", + "fieldtype": "Check", + "label": "Very bad \u2013 I wake up every 2-3 hours" + }, + { + "default": "0", + "fieldname": "bad_i_wake_up_1_2_times_per_night", + "fieldtype": "Check", + "label": "Bad \u2013 I wake up 1-2 times per night" + }, + { + "default": "0", + "fieldname": "ok", + "fieldtype": "Check", + "label": "Ok" + }, + { + "default": "0", + "fieldname": "good", + "fieldtype": "Check", + "label": "Good" + }, + { + "fieldname": "morning_heading", + "fieldtype": "Heading", + "label": "Do you have energy in the morning?" + }, + { + "default": "0", + "fieldname": "morning_yes", + "fieldtype": "Check", + "label": "Yes" + }, + { + "default": "0", + "fieldname": "morning_no", + "fieldtype": "Check", + "label": "No" + }, + { + "description": "Check all that apply", + "fieldname": "sleep_optimize_heading", + "fieldtype": "Heading", + "label": "Do you use any sleep optimization strategies?" + }, + { + "default": "0", + "fieldname": "blue_light_blocking_glasses", + "fieldtype": "Check", + "label": "Blue light blocking glasses" + }, + { + "default": "0", + "fieldname": "meditation_or_relaxation_techniques", + "fieldtype": "Check", + "label": "Meditation or relaxation techniques" + }, + { + "default": "0", + "description": "(magnesium, melatonin, etc.)", + "fieldname": "sleep_supplements", + "fieldtype": "Check", + "label": "Sleep supplements" + }, + { + "default": "0", + "fieldname": "cold_exposure_before_bed", + "fieldtype": "Check", + "label": "Cold exposure before bed" + }, + { + "fieldname": "sleep_optimize_other", + "fieldtype": "Small Text", + "label": "Other" + }, + { + "description": "Check all that apply", + "fieldname": "exercise_heading", + "fieldtype": "Heading", + "label": "Do you engage in any of the following exercise routines?" + }, + { + "default": "0", + "description": "(weights, bodyweight exercises)", + "fieldname": "resistance_training", + "fieldtype": "Check", + "label": "Resistance training" + }, + { + "default": "0", + "description": "(running, cycling, swimming)", + "fieldname": "cardiovascular_training", + "fieldtype": "Check", + "label": "Cardiovascular training" + }, + { + "default": "0", + "fieldname": "body_posture_optimisation", + "fieldtype": "Check", + "label": "Body Posture optimisation" + }, + { + "default": "0", + "fieldname": "high_intensity_interval_training", + "fieldtype": "Check", + "label": "High-intensity interval training (HIIT)" + }, + { + "default": "0", + "fieldname": "yoga_pilates", + "fieldtype": "Check", + "label": "Yoga/Pilates" + }, + { + "fieldname": "exercise_other", + "fieldtype": "Small Text", + "label": "Other" + }, + { + "fieldname": "medical_metabolic_health_section", + "fieldtype": "Section Break", + "label": "Medical & Metabolic Health" + }, + { + "description": "Check all that apply", + "fieldname": "metaboli_history_heading", + "fieldtype": "Heading", + "label": "Do you have a history of any of the following?" + }, + { + "default": "0", + "fieldname": "cardiovascular_disease", + "fieldtype": "Check", + "label": "Cardiovascular disease" + }, + { + "default": "0", + "fieldname": "diabetes_or_insulin_resistance", + "fieldtype": "Check", + "label": "Diabetes or insulin resistance" + }, + { + "default": "0", + "description": "(Alzheimer\u2019s, Parkinson\u2019s)", + "fieldname": "neurodegenerative_conditions", + "fieldtype": "Check", + "label": "Neurodegenerative conditions" + }, + { + "default": "0", + "fieldname": "osteoporosis_or_osteopenia", + "fieldtype": "Check", + "label": "Osteoporosis or osteopenia" + }, + { + "default": "0", + "fieldname": "autoimmune_disorders", + "fieldtype": "Check", + "label": "Autoimmune disorders" + }, + { + "default": "0", + "fieldname": "cancer", + "fieldtype": "Check", + "label": "Cancer" + }, + { + "default": "0", + "description": "(thyroid, adrenal fatigue, menopause/andropause)", + "fieldname": "hormonal_imbalances", + "fieldtype": "Check", + "label": "Hormonal imbalances" + }, + { + "default": "0", + "fieldname": "chronic_inflammation_or_metabolic_dysfunction", + "fieldtype": "Check", + "label": "Chronic inflammation or metabolic dysfunction" + }, + { + "fieldname": "metaboli_history_other", + "fieldtype": "Small Text", + "label": "Other" + }, + { + "fieldname": "supplements_heading", + "fieldtype": "Heading", + "label": "Do you currently take any longevity-related supplements or medications?" + }, + { + "default": "0", + "description": "(NR/NMN)", + "fieldname": "nad_precursors", + "fieldtype": "Check", + "label": "NAD+ precursors" + }, + { + "default": "0", + "description": "(for metabolic health)", + "fieldname": "metformin_or_berberine", + "fieldtype": "Check", + "label": "Metformin or berberine" + }, + { + "default": "0", + "fieldname": "rapamycin", + "fieldtype": "Check", + "label": "Rapamycin" + }, + { + "default": "0", + "fieldname": "resveratrol_quercetin", + "fieldtype": "Check", + "label": "Resveratrol/quercetin" + }, + { + "default": "0", + "fieldname": "collagen_or_hyaluronic_acid", + "fieldtype": "Check", + "label": "Collagen or hyaluronic acid" + }, + { + "default": "0", + "fieldname": "omega_3", + "fieldtype": "Check", + "label": "Omega-3 or other anti-inflammatory supplements" + }, + { + "fieldname": "supplements_other", + "fieldtype": "Small Text", + "label": "Other" + }, + { + "fieldname": "therapies_heading", + "fieldtype": "Heading", + "label": "Have you undergone any longevity-related therapies?" + }, + { + "default": "0", + "fieldname": "hyperbaric_oxygen_therapy", + "fieldtype": "Check", + "label": "Hyperbaric oxygen therapy" + }, + { + "default": "0", + "fieldname": "ozone_therapy", + "fieldtype": "Check", + "label": "Ozone therapy" + }, + { + "default": "0", + "fieldname": "peptide_therapy", + "fieldtype": "Check", + "label": "Peptide therapy" + }, + { + "default": "0", + "fieldname": "stem_cell_therapy", + "fieldtype": "Check", + "label": "Stem cell therapy" + }, + { + "default": "0", + "fieldname": "cryotherapy_or_cold_exposure_therapy", + "fieldtype": "Check", + "label": "Cryotherapy or cold exposure therapy" + }, + { + "fieldname": "therapies_other", + "fieldtype": "Small Text", + "label": "Other" + }, + { + "fieldname": "monitor_heading", + "fieldtype": "Heading", + "label": "Do you currently monitor any of the following?" + }, + { + "default": "0", + "fieldname": "blood_glucose_levels", + "fieldtype": "Check", + "label": "Blood glucose levels" + }, + { + "default": "0", + "fieldname": "heart_rate_variability", + "fieldtype": "Check", + "label": "Heart rate variability (HRV)" + }, + { + "default": "0", + "description": "(Oura ring, Whoop, smart watch etc.)", + "fieldname": "sleep_quality", + "fieldtype": "Check", + "label": "Sleep quality" + }, + { + "default": "0", + "description": "(DEXA scan, etc.)", + "fieldname": "body_composition", + "fieldtype": "Check", + "label": "Body composition" + }, + { + "fieldname": "monitor_other", + "fieldtype": "Small Text", + "label": "Other" + }, + { + "fieldname": "well_being_section", + "fieldtype": "Section Break", + "label": "Stress & Emotional Well-being" + }, + { + "fieldname": "how_would_you_describe_your_stress_levels", + "fieldtype": "Heading", + "label": "How would you describe your stress levels?" + }, + { + "default": "0", + "fieldname": "low", + "fieldtype": "Check", + "label": "Low" + }, + { + "default": "0", + "fieldname": "moderate", + "fieldtype": "Check", + "label": "Moderate" + }, + { + "default": "0", + "fieldname": "high", + "fieldtype": "Check", + "label": "High" + }, + { + "fieldname": "how_do_you_manage_stress", + "fieldtype": "Heading", + "label": "How do you manage stress?" + }, + { + "default": "0", + "fieldname": "meditation_or_mindfulness_practices", + "fieldtype": "Check", + "label": "Meditation or mindfulness practices" + }, + { + "default": "0", + "fieldname": "breathing_exercises", + "fieldtype": "Check", + "label": "Breathing exercises" + }, + { + "default": "0", + "fieldname": "regular_exercise", + "fieldtype": "Check", + "label": "Regular exercise" + }, + { + "default": "0", + "fieldname": "social_engagement_and_relationships", + "fieldtype": "Check", + "label": "Social engagement and relationships" + }, + { + "default": "0", + "fieldname": "professional_therapy_or_coaching", + "fieldtype": "Check", + "label": "Professional therapy or coaching" + }, + { + "fieldname": "stress_other", + "fieldtype": "Small Text", + "label": "Other" + }, + { + "fieldname": "emotiona_well_being_section", + "fieldtype": "Section Break", + "label": "Emotional & Mental Well-being" + }, + { + "fieldname": "emotional_well_being_heading", + "fieldtype": "Heading", + "label": "How would you describe your overall emotional and mental well-being?" + }, + { + "default": "0", + "description": "I generally feel positive, resilient, and able to handle stress effectively.", + "fieldname": "emotionally_balanced", + "fieldtype": "Check", + "label": "Emotionally balanced" + }, + { + "default": "0", + "description": "I experience mild stress but can manage it with healthy coping strategies.", + "fieldname": "occasionally_stressed", + "fieldtype": "Check", + "label": "Occasionally stressed" + }, + { + "default": "0", + "description": "I often feel stressed, anxious, or emotionally drained.", + "fieldname": "frequently_overwhelmed", + "fieldtype": "Check", + "label": "Frequently overwhelmed" + }, + { + "default": "0", + "description": "I experience persistent emotional distress, anxiety, or depressive moods.", + "fieldname": "struggling_emotionally", + "fieldtype": "Check", + "label": "Struggling emotionally" + }, + { + "default": "0", + "description": "I feel I would benefit from emotional or psychological support to improve my well-being.", + "fieldname": "seeking_support", + "fieldtype": "Check", + "label": "Seeking support" + }, + { + "fieldname": "social_well_being_section", + "fieldtype": "Section Break", + "label": "Social Well-being" + }, + { + "fieldname": "how_would_you_describe_your_social_connections", + "fieldtype": "Heading", + "label": "How would you describe your social connections?" + }, + { + "default": "0", + "fieldname": "i_have_strong_and_meaningful_relationships", + "fieldtype": "Check", + "label": "I have strong and meaningful relationships" + }, + { + "default": "0", + "fieldname": "social_connection_check", + "fieldtype": "Check", + "label": "I have some social connections but would like to strengthen them" + }, + { + "default": "0", + "fieldname": "i_often_feel_socially_isolated_or_disconnected", + "fieldtype": "Check", + "label": "I often feel socially isolated or disconnected" + }, + { + "fieldname": "environmental_toxin_exposure_section", + "fieldtype": "Section Break", + "label": "Environmental & Toxin Exposure" + }, + { + "fieldname": "toxins_heading", + "fieldtype": "Heading", + "label": "Have you been exposed to heavy metals, mold, or other environmental toxins?" + }, + { + "default": "0", + "description": "(amalgam dental fillings, fish consumption)", + "fieldname": "mercury", + "fieldtype": "Check", + "label": "Mercury" + }, + { + "default": "0", + "fieldname": "lead", + "fieldtype": "Check", + "label": "Lead" + }, + { + "default": "0", + "fieldname": "mold_toxicity", + "fieldtype": "Check", + "label": "Mold toxicity" + }, + { + "fieldname": "toxins_other", + "fieldtype": "Small Text", + "label": "Other" + }, + { + "fieldname": "toxin_measure_section", + "fieldtype": "Heading", + "label": "Do you take any measures to reduce toxin exposure?" + }, + { + "default": "0", + "fieldname": "air_purification_at_home", + "fieldtype": "Check", + "label": "Air purification at home" + }, + { + "default": "0", + "fieldname": "filtered_water", + "fieldtype": "Check", + "label": "Filtered water" + }, + { + "default": "0", + "fieldname": "organic_diet", + "fieldtype": "Check", + "label": "Organic diet" + }, + { + "default": "0", + "fieldname": "regular_sauna_use_for_detoxification", + "fieldtype": "Check", + "label": "Regular sauna use for detoxification" + }, + { + "fieldname": "toxin_measure_other", + "fieldtype": "Small Text", + "label": "Other" + } + ], + "index_web_pages_for_search": 1, + "links": [ + { + "link_doctype": "Lead", + "link_fieldname": "custom_longevity_history" + }, + { + "link_doctype": "Patient", + "link_fieldname": "custom_longevity_history" + } + ], + "modified": "2025-02-21 08:38:48.602536", + "modified_by": "Administrator", + "module": "Swissmedhealth", + "name": "Longevity History", + "naming_rule": "By \"Naming Series\" field", + "owner": "Administrator", + "permissions": [ + { + "create": 1, + "delete": 1, + "email": 1, + "export": 1, + "print": 1, + "read": 1, + "report": 1, + "role": "System Manager", + "share": 1, + "write": 1 + } + ], + "sort_field": "modified", + "sort_order": "DESC", + "states": [] +} \ No newline at end of file diff --git a/swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.py b/swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.py new file mode 100644 index 0000000..9809149 --- /dev/null +++ b/swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.py @@ -0,0 +1,9 @@ +# Copyright (c) 2025, KAINOTOMO PH LTD and contributors +# For license information, please see license.txt + +# import frappe +from frappe.model.document import Document + + +class LongevityHistory(Document): + pass diff --git a/swissmedhealth/swissmedhealth/doctype/longevity_history/test_longevity_history.py b/swissmedhealth/swissmedhealth/doctype/longevity_history/test_longevity_history.py new file mode 100644 index 0000000..9fa3827 --- /dev/null +++ b/swissmedhealth/swissmedhealth/doctype/longevity_history/test_longevity_history.py @@ -0,0 +1,9 @@ +# Copyright (c) 2025, KAINOTOMO PH LTD and Contributors +# See license.txt + +# import frappe +from frappe.tests.utils import FrappeTestCase + + +class TestLongevityHistory(FrappeTestCase): + pass From e53efaec037a9e2201c6d751e7b7a68e0ad36985 Mon Sep 17 00:00:00 2001 From: Panayiotis Halouvas Date: Fri, 21 Feb 2025 07:53:30 +0000 Subject: [PATCH 03/10] Add patient longevity forms and related functionality --- .../longevity_history/longevity_history.json | 65 +- .../patient_longevity_form_1/__init__.py | 0 .../patient_longevity_form_1.js | 79 + .../patient_longevity_form_1.json | 632 ++++++ .../patient_longevity_form_1.py | 5 + .../patient_longevity_form_2/__init__.py | 0 .../patient_longevity_form_2.js | 39 + .../patient_longevity_form_2.json | 2017 +++++++++++++++++ .../patient_longevity_form_2.py | 26 + 9 files changed, 2862 insertions(+), 1 deletion(-) create mode 100644 swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/__init__.py create mode 100644 swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.js create mode 100644 swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json create mode 100644 swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.py create mode 100644 swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/__init__.py create mode 100644 swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.js create mode 100644 swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.json create mode 100644 swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.py diff --git a/swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.json b/swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.json index 4cccef9..9f0b017 100644 --- a/swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.json +++ b/swissmedhealth/swissmedhealth/doctype/longevity_history/longevity_history.json @@ -46,6 +46,10 @@ "12_16_hours", "more_than_16_hours", "protein_heading", + "plant_based", + "animal_based", + "combination_of_both", + "sleep_hours_heading", "less_than_5_hours", "5_6_hours", "7_8_hours", @@ -127,6 +131,11 @@ "i_have_strong_and_meaningful_relationships", "social_connection_check", "i_often_feel_socially_isolated_or_disconnected", + "social_activities_heading", + "daily", + "a_few_times_a_week", + "a_few_times_a_month", + "rarely_or_never", "environmental_toxin_exposure_section", "toxins_heading", "mercury", @@ -925,6 +934,60 @@ "fieldname": "toxin_measure_other", "fieldtype": "Small Text", "label": "Other" + }, + { + "default": "0", + "description": "(e.g., legumes, tofu)", + "fieldname": "plant_based", + "fieldtype": "Check", + "label": "Plant-based" + }, + { + "default": "0", + "description": "(e.g., grass-fed meat, wild fish)", + "fieldname": "animal_based", + "fieldtype": "Check", + "label": "Animal-based" + }, + { + "default": "0", + "fieldname": "combination_of_both", + "fieldtype": "Check", + "label": "Combination of both" + }, + { + "fieldname": "sleep_hours_heading", + "fieldtype": "Heading", + "label": "How many hours of sleep do you get per night?" + }, + { + "fieldname": "social_activities_heading", + "fieldtype": "Heading", + "label": "How often do you engage in social activities or meaningful interactions?" + }, + { + "default": "0", + "fieldname": "daily", + "fieldtype": "Check", + "label": "Daily" + }, + { + "default": "0", + "fieldname": "a_few_times_a_week", + "fieldtype": "Check", + "label": "A few times a week" + }, + { + "default": "0", + "fieldname": "a_few_times_a_month", + "fieldtype": "Check", + "label": "A few times a month" + }, + { + "default": "0", + "fieldname": "rarely_or_never", + "fieldtype": "Check", + "label": "Rarely or never" } ], "index_web_pages_for_search": 1, @@ -938,7 +1001,7 @@ "link_fieldname": "custom_longevity_history" } ], - "modified": "2025-02-21 08:38:48.602536", + "modified": "2025-02-21 09:29:11.016137", "modified_by": "Administrator", "module": "Swissmedhealth", "name": "Longevity History", diff --git a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/__init__.py b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.js b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.js new file mode 100644 index 0000000..1a2e18e --- /dev/null +++ b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.js @@ -0,0 +1,79 @@ +frappe.ready(function () { + + let params = new URLSearchParams(window.location.search); + let email_id = params.get('email_id'); + if (email_id) { + frappe.call('swissmedhealth.swissmedhealth.web_form.medical_history.medical_history.get_lead_details', { email_id: email_id }).then(r => { + let doc = r.message; + + frappe.web_form.set_values(doc); + frappe.web_form.is_new = false; + frappe.web_form.doc.name = doc.name; + + // Check if custom_referral_code is not empty and make it read-only + if (doc.custom_referral_code) { + frappe.web_form.set_df_property('custom_referral_code', 'read_only', 1); + } + }); + } + + // set referral code from URL + let referral_code = params.get('referral_code'); + if (referral_code) { + frappe.web_form.set_value('custom_referral_code', referral_code); + } + + // bind events here + frappe.web_form.after_save = () => { + let email_id = frappe.web_form.doc.email_id; + let href = '/patient-longevity-form-2/new?email_id=' + encodeURIComponent(email_id); + // Get the redirect button with class name "new-btn" and set the href attribute + $('.new-btn').attr('href', href); + // Also change the text of the button to "Please complete your medical history here" + $('.new-btn').text('Medical information Form'); + } + + $('.submit-btn').on('click', async function (e) { + + // Get the email from the URL + let params = new URLSearchParams(window.location.search); + let email_id = params.get('email_id'); + if (!email_id) { + // Get the email_id from the submitted form + email_id = frappe.web_form.doc.email_id; + let r = await frappe.call('swissmedhealth.swissmedhealth.web_form.medical_history.medical_history.get_lead_details', { email_id: email_id, throw_error: false }); + if (r.message == undefined) { + return; + } + frappe.web_form.doc.name = r.message.name; + // Prevent the default form submission + e.preventDefault(); + + frappe.call('swissmedhealth.swissmedhealth.web_form.medical_history.medical_history.save', { doc: frappe.web_form.doc }).then(r => { + let email_id = r.message.email_id; + window.location.href = '../patient-longevity-form-2/new?email_id=' + encodeURIComponent(email_id); + }).catch((err) => { + frappe.msgprint({ + title: __('Error'), + indicator: 'red', + message: __('An error occurred while submitting your details. Please try again later.') + }); + }); + } else { + // Prevent the default form submission + e.preventDefault(); + frappe.call('swissmedhealth.swissmedhealth.web_form.medical_history.medical_history.save', { doc: frappe.web_form.doc }).then(r => { + let email_id = r.message.email_id; + window.location.href = '../patient-longevity-form-2/new?email_id=' + encodeURIComponent(email_id); + }).catch((err) => { + frappe.msgprint({ + title: __('Error'), + indicator: 'red', + message: __('An error occurred while submitting your details. Please try again later.') + }); + }); + } + + }); + +}) \ No newline at end of file diff --git a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json new file mode 100644 index 0000000..dd903fe --- /dev/null +++ b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json @@ -0,0 +1,632 @@ +{ + "accept_payment": 0, + "allow_comments": 0, + "allow_delete": 0, + "allow_edit": 0, + "allow_incomplete": 0, + "allow_multiple": 0, + "allow_print": 0, + "amount": 0.0, + "amount_based_on_field": 0, + "anonymous": 1, + "apply_document_permissions": 0, + "banner_image": "/files/registration-form.png", + "breadcrumbs": "", + "button_label": "Next", + "condition_json": "[]", + "creation": "2025-02-21 08:45:56.906648", + "currency": "EUR", + "custom_css": ".web-form-title,\r\n.ellipsis{\r\n overflow: visible;\r\n word-wrap: break-word;\r\n white-space: wrap;\r\n}\r\n", + "doc_type": "Lead", + "docstatus": 0, + "doctype": "Web Form", + "idx": 0, + "introduction_text": "

Please complete this form as accurately as possible to help us develop a personalized longevity plan for you.

", + "is_standard": 1, + "list_columns": [ + { + "fieldname": "first_name", + "fieldtype": "Data", + "label": "First Name" + } + ], + "list_title": "Test", + "login_required": 0, + "max_attachment_size": 0, + "modified": "2025-02-21 09:52:37.655439", + "modified_by": "Administrator", + "module": "Swissmedhealth", + "name": "patient-longevity-form-1", + "owner": "Administrator", + "payment_button_label": "Buy Now", + "published": 1, + "route": "patient-longevity-form-1", + "show_attachments": 0, + "show_list": 0, + "show_sidebar": 0, + "success_message": "Thank you for providing your contact information. We invite you to proceed with the next step of completing your medical information. Please click on the button below to continue. We appreciate your attention to these details, ensuring we can offer you the best possible service.", + "success_title": "", + "success_url": "", + "title": "Patient Longevity Form", + "web_form_fields": [ + { + "allow_read_on_all_link_options": 0, + "default": "Myself", + "fieldname": "custom_contact_relative", + "fieldtype": "Select", + "hidden": 0, + "label": "I am requesting information for", + "max_length": 0, + "max_value": 0, + "options": "Myself\nFor relative", + "precision": "", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "From online form", + "fieldname": "custom_status", + "fieldtype": "Select", + "hidden": 1, + "label": "Status", + "max_length": 0, + "max_value": 0, + "options": "Lead\nFrom online form\nDocumentation sent\nDocumentation received\nConsultation recommended\nInvoice issued\nInvoice Paid\nConsultation\nMedical Proposal\nNot Interested\nConverted\nNot contact\nOpportunity", + "precision": "", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "depends_on": "", + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Contact Details", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "salutation", + "fieldtype": "Link", + "hidden": 0, + "label": "Salutation", + "max_length": 0, + "max_value": 0, + "options": "Salutation", + "precision": "", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "first_name", + "fieldtype": "Data", + "hidden": 0, + "label": "First Name", + "mandatory_depends_on": "eval: !(doc.company_name)", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "last_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Last Name", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "gender", + "fieldtype": "Link", + "hidden": 0, + "label": "Gender", + "max_length": 0, + "max_value": 0, + "options": "Gender", + "precision": "", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Column Break", + "hidden": 0, + "label": "", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "email_id", + "fieldtype": "Data", + "hidden": 0, + "label": "Email", + "max_length": 0, + "max_value": 0, + "options": "Email", + "precision": "", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "phone", + "fieldtype": "Phone", + "hidden": 0, + "label": "Phone", + "max_length": 0, + "max_value": 0, + "options": "Phone", + "precision": "", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_dob", + "fieldtype": "Date", + "hidden": 0, + "label": "Date of birth", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_occupation", + "fieldtype": "Data", + "hidden": 0, + "label": "Line of business", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_new_national_id", + "fieldtype": "Data", + "hidden": 0, + "label": "National ID / ARC No", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_customer_primary_address", + "fieldtype": "Link", + "hidden": 1, + "label": "Customer Primary Address", + "max_length": 0, + "max_value": 0, + "options": "Address", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Address", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_street_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Street Name & Number", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_building_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Building name & Apt No", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Column Break", + "hidden": 0, + "label": "", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "city", + "fieldtype": "Data", + "hidden": 0, + "label": "City", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_post_code", + "fieldtype": "Data", + "hidden": 0, + "label": "Post code", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "country", + "fieldtype": "Link", + "hidden": 0, + "label": "Country", + "max_length": 0, + "max_value": 0, + "options": "Country", + "precision": "", + "read_only": 0, + "reqd": 1, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "depends_on": "eval:doc.custom_contact_relative!=\"For relative\"", + "fieldname": "custom_relative_first_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Emergency contact name", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Column Break", + "hidden": 0, + "label": "", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "depends_on": "eval:doc.custom_contact_relative!=\"For relative\"", + "fieldname": "custom_relative_phone", + "fieldtype": "Phone", + "hidden": 0, + "label": "Emergency contact phone", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_how_did_you_hear_about_us", + "fieldtype": "Select", + "hidden": 0, + "label": "How did you hear about us", + "max_length": 0, + "max_value": 0, + "options": "Web\nSocial Media\nReferral\nDirect", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_consultation_location_preference", + "fieldtype": "Select", + "hidden": 0, + "label": "Consultation Location Preference", + "max_length": 0, + "max_value": 0, + "options": "Limassol\nNicosia\nOnline", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "depends_on": "eval:doc.custom_contact_relative==\"For relative\"", + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Relative", + "mandatory_depends_on": "", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_relative_salutation", + "fieldtype": "Link", + "hidden": 0, + "label": "Salutation", + "mandatory_depends_on": "eval:doc.custom_contact_relative==\"For relative\"", + "max_length": 0, + "max_value": 0, + "options": "Salutation", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_relative_first_name", + "fieldtype": "Data", + "hidden": 0, + "label": "First Name", + "mandatory_depends_on": "eval:doc.custom_contact_relative==\"For relative\"", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_relative_last_name", + "fieldtype": "Data", + "hidden": 0, + "label": "Last Name", + "mandatory_depends_on": "eval:doc.custom_contact_relative==1", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_relative_gender", + "fieldtype": "Link", + "hidden": 0, + "label": "Gender", + "mandatory_depends_on": "eval:doc.custom_contact_relative==\"For relative\"", + "max_length": 0, + "max_value": 0, + "options": "Gender", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Column Break", + "hidden": 0, + "label": "", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_relation", + "fieldtype": "Select", + "hidden": 0, + "label": "Relation", + "mandatory_depends_on": "eval:doc.custom_contact_relative==1", + "max_length": 0, + "max_value": 0, + "options": "Father\nMother\nParent\nSon\nDaughter\nHusband\nWife\nSpouse\nBrother\nSister\nSibling\nGrandfather\nGrandmother\nGrandparent\nGrandson\nGranddaughter\nGrandchild\nUncle\nAunt\nNephew\nNiece\nCousin", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_relative_email_id", + "fieldtype": "Data", + "hidden": 0, + "label": "Email", + "mandatory_depends_on": "eval:doc.custom_contact_relative==1", + "max_length": 0, + "max_value": 0, + "options": "Email", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "depends_on": "", + "fieldname": "custom_relative_phone", + "fieldtype": "Phone", + "hidden": 0, + "label": "Phone", + "mandatory_depends_on": "eval:doc.custom_contact_relative==\"For relative\"", + "max_length": 0, + "max_value": 0, + "options": "Phone", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "custom_relative_country", + "fieldtype": "Link", + "hidden": 0, + "label": "Country", + "mandatory_depends_on": "eval:doc.custom_contact_relative==\"For relative\"", + "max_length": 0, + "max_value": 0, + "options": "Country", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 1, + "label": "", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "description": "Fill in this field only if you have a referral code", + "fieldname": "custom_referral_code", + "fieldtype": "Data", + "hidden": 0, + "label": "Referral Code", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + } + ] +} \ No newline at end of file diff --git a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.py b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.py new file mode 100644 index 0000000..e1ada61 --- /dev/null +++ b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.py @@ -0,0 +1,5 @@ +import frappe + +def get_context(context): + # do your magic here + pass diff --git a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/__init__.py b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.js b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.js new file mode 100644 index 0000000..1acf4f7 --- /dev/null +++ b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.js @@ -0,0 +1,39 @@ +frappe.ready(function () { + + let params = new URLSearchParams(window.location.search); + let email_id = params.get('email_id'); + if (email_id) { + frappe.call('swissmedhealth.swissmedhealth.web_form.patient_longevity_form_2.patient_longevity_form_2.get_longevity_history_details', { email_id: email_id }).then(r => { + let doc = r.message; + + frappe.web_form.set_values(doc); + frappe.web_form.is_new = false; + frappe.web_form.doc.name = doc.name; + }); + } else { + // redirect to home page + window.location.href = '/'; + } + + // bind events here + $('.submit-btn').on('click', function (e) { + // Prevent the default form submission + e.preventDefault(); + + // set custom_status to 'Documentation received' + frappe.web_form.doc.custom_status = 'Documentation received'; + + frappe.call('swissmedhealth.swissmedhealth.web_form.patient_longevity_form_2.patient_longevity_form_2.save_longevity_history', { doc: frappe.web_form.doc }).then(() => { + let params = new URLSearchParams(window.location.search); + let email_id = params.get('email_id'); + window.location.href = '../lead-step-4/new?email_id=' + encodeURIComponent(email_id); + }).catch((err) => { + frappe.msgprint({ + title: __('Error'), + indicator: 'red', + message: __('An error occurred while submitting your details. Please try again later.') + }); + }); + }); + +}) \ No newline at end of file diff --git a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.json b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.json new file mode 100644 index 0000000..185390e --- /dev/null +++ b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.json @@ -0,0 +1,2017 @@ +{ + "accept_payment": 0, + "allow_comments": 0, + "allow_delete": 0, + "allow_edit": 0, + "allow_incomplete": 0, + "allow_multiple": 0, + "allow_print": 0, + "amount": 0.0, + "amount_based_on_field": 0, + "anonymous": 1, + "apply_document_permissions": 0, + "banner_image": "/files/registration-form.png", + "button_label": "Next", + "client_script": ".web-form-title,\r\n.ellipsis{\r\n overflow: visible;\r\n word-wrap: break-word;\r\n white-space: wrap;\r\n}\r\n", + "condition_json": "[]", + "creation": "2025-02-21 08:50:38.670437", + "currency": "EUR", + "doc_type": "Longevity History", + "docstatus": 0, + "doctype": "Web Form", + "idx": 0, + "introduction_text": "

Please complete this form as accurately as possible to help us develop a personalized longevity plan for you.

", + "is_standard": 1, + "list_columns": [], + "login_required": 0, + "max_attachment_size": 0, + "modified": "2025-02-21 09:33:02.128324", + "modified_by": "Administrator", + "module": "Swissmedhealth", + "name": "patient-longevity-form-2", + "owner": "Administrator", + "payment_button_label": "Buy Now", + "published": 1, + "route": "patient-longevity-form-2", + "show_attachments": 0, + "show_list": 0, + "show_sidebar": 0, + "title": "Patient Longevity Form", + "web_form_fields": [ + { + "allow_read_on_all_link_options": 0, + "fieldname": "heading_1", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Longevity & Health Goals", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "What are your main longevity-related concerns or goals?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "increase_energy_levels", + "fieldtype": "Check", + "hidden": 0, + "label": "Increase energy levels", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "increase_energy_levels", + "fieldtype": "Check", + "hidden": 0, + "label": "Increase energy levels", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "improve_cognitive_function", + "fieldtype": "Check", + "hidden": 0, + "label": "Improve cognitive function", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "enhance_physical_performance_and_mobility", + "fieldtype": "Check", + "hidden": 0, + "label": "Enhance physical performance and mobility", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "slow_down_biological_aging", + "fieldtype": "Check", + "hidden": 0, + "label": "Slow down biological aging", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "improve_sleep_quality", + "fieldtype": "Check", + "hidden": 0, + "label": "Improve sleep quality", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "reduce_inflammation_and_oxidative_stress", + "fieldtype": "Check", + "hidden": 0, + "label": "Reduce inflammation and oxidative stress", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "prevent_age_related_diseases", + "fieldtype": "Check", + "hidden": 0, + "label": "Prevent age-related diseases", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "reduce_stress", + "fieldtype": "Check", + "hidden": 0, + "label": "Reduce stress", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "goals_other", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Other", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Do you track your biological age or metabolic age?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "track_yes", + "fieldtype": "Check", + "hidden": 0, + "label": "Yes", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "depends_on": "eval:doc.track_yes==1;", + "fieldname": "track_desc", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Please provide the latest result", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "track_no", + "fieldtype": "Check", + "hidden": 0, + "label": "No", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Have you done any of the following longevity-related tests?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "dna_methylation_test", + "fieldtype": "Check", + "hidden": 0, + "label": "DNA methylation test", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "biological_age_test", + "fieldtype": "Check", + "hidden": 0, + "label": "Biological Age Test", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "hormone_panel", + "fieldtype": "Check", + "hidden": 0, + "label": "Hormone panel", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "advanced_lipid_panel", + "fieldtype": "Check", + "hidden": 0, + "label": "Advanced lipid panel", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "inflammation_markers", + "fieldtype": "Check", + "hidden": 0, + "label": "Inflammation markers", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "insulin_sensitivity_test", + "fieldtype": "Check", + "hidden": 0, + "label": "Insulin sensitivity test", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "gut_microbiome_analysis", + "fieldtype": "Check", + "hidden": 0, + "label": "Gut microbiome analysis", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "mitochondrial_function_test", + "fieldtype": "Check", + "hidden": 0, + "label": "Mitochondrial function test", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "heavy_metal_test", + "fieldtype": "Check", + "hidden": 0, + "label": "Heavy metal test", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "tests_other", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Other", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Page Break", + "hidden": 0, + "label": "Lifestyle & Daily Habits", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Do you follow a specific longevity-based diet?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "mediterranean_diet", + "fieldtype": "Check", + "hidden": 0, + "label": "Mediterranean diet", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "ketogenic_low_carb_diet", + "fieldtype": "Check", + "hidden": 0, + "label": "Ketogenic/Low-carb diet", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "intermittent_fasting_or_time_restricted_eating", + "fieldtype": "Check", + "hidden": 0, + "label": "Intermittent fasting or time-restricted eating", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "plant_based_diet", + "fieldtype": "Check", + "hidden": 0, + "label": "Plant-based diet", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "diet_other", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Other", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "How many hours do you fast daily?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "less_than_10_hours", + "fieldtype": "Check", + "hidden": 0, + "label": "Less than 10 hours", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "10_12_hours", + "fieldtype": "Check", + "hidden": 0, + "label": "10-12 hours", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "12_16_hours", + "fieldtype": "Check", + "hidden": 0, + "label": "12-16 hours", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "more_than_16_hours", + "fieldtype": "Check", + "hidden": 0, + "label": "More than 16 hours", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "What are your main sources of protein?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "plant_based_diet", + "fieldtype": "Check", + "hidden": 0, + "label": "Plant-based diet", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "animal_based", + "fieldtype": "Check", + "hidden": 0, + "label": "Animal-based", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "combination_of_both", + "fieldtype": "Check", + "hidden": 0, + "label": "Combination of both", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "How many hours of sleep do you get per night?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "less_than_5_hours", + "fieldtype": "Check", + "hidden": 0, + "label": "Less than 5 hours", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "5_6_hours", + "fieldtype": "Check", + "hidden": 0, + "label": "5-6 hours", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "7_8_hours", + "fieldtype": "Check", + "hidden": 0, + "label": "7-8 hours", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "more_than_8_hours", + "fieldtype": "Check", + "hidden": 0, + "label": "More than 8 hours", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "How is your sleep quality?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "very_bad_i_wake_up_every_2_3_hours", + "fieldtype": "Check", + "hidden": 0, + "label": "Very bad \u2013 I wake up every 2-3 hours", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "bad_i_wake_up_1_2_times_per_night", + "fieldtype": "Check", + "hidden": 0, + "label": "Bad \u2013 I wake up 1-2 times per night", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "ok", + "fieldtype": "Check", + "hidden": 0, + "label": "Ok", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "good", + "fieldtype": "Check", + "hidden": 0, + "label": "Good", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Do you have energy in the morning?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "morning_yes", + "fieldtype": "Check", + "hidden": 0, + "label": "Yes", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "morning_no", + "fieldtype": "Check", + "hidden": 0, + "label": "No", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Do you use any sleep optimization strategies?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "blue_light_blocking_glasses", + "fieldtype": "Check", + "hidden": 0, + "label": "Blue light blocking glasses", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "meditation_or_relaxation_techniques", + "fieldtype": "Check", + "hidden": 0, + "label": "Meditation or relaxation techniques", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "sleep_supplements", + "fieldtype": "Check", + "hidden": 0, + "label": "Sleep supplements", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "cold_exposure_before_bed", + "fieldtype": "Check", + "hidden": 0, + "label": "Cold exposure before bed", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "sleep_optimize_other", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Other", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Do you engage in any of the following exercise routines?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "resistance_training", + "fieldtype": "Check", + "hidden": 0, + "label": "Resistance training", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "cardiovascular_training", + "fieldtype": "Check", + "hidden": 0, + "label": "Cardiovascular training", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "body_posture_optimisation", + "fieldtype": "Check", + "hidden": 0, + "label": "Body Posture optimisation", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "high_intensity_interval_training", + "fieldtype": "Check", + "hidden": 0, + "label": "High-intensity interval training (HIIT)", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "yoga_pilates", + "fieldtype": "Check", + "hidden": 0, + "label": "Yoga/Pilates", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "exercise_other", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Other", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Page Break", + "hidden": 0, + "label": "Medical & Metabolic Health", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Do you have a history of any of the following?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "cardiovascular_disease", + "fieldtype": "Check", + "hidden": 0, + "label": "Cardiovascular disease", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "diabetes_or_insulin_resistance", + "fieldtype": "Check", + "hidden": 0, + "label": "Diabetes or insulin resistance", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "neurodegenerative_conditions", + "fieldtype": "Check", + "hidden": 0, + "label": "Neurodegenerative conditions", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "osteoporosis_or_osteopenia", + "fieldtype": "Check", + "hidden": 0, + "label": "Osteoporosis or osteopenia", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "autoimmune_disorders", + "fieldtype": "Check", + "hidden": 0, + "label": "Autoimmune disorders", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "cancer", + "fieldtype": "Check", + "hidden": 0, + "label": "Cancer", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "hormonal_imbalances", + "fieldtype": "Check", + "hidden": 0, + "label": "Hormonal imbalances", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "chronic_inflammation_or_metabolic_dysfunction", + "fieldtype": "Check", + "hidden": 0, + "label": "Chronic inflammation or metabolic dysfunction", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "metaboli_history_other", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Other", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Do you currently take any longevity-related supplements or medications?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "nad_precursors", + "fieldtype": "Check", + "hidden": 0, + "label": "NAD+ precursors", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "metformin_or_berberine", + "fieldtype": "Check", + "hidden": 0, + "label": "Metformin or berberine", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "rapamycin", + "fieldtype": "Check", + "hidden": 0, + "label": "Rapamycin", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "resveratrol_quercetin", + "fieldtype": "Check", + "hidden": 0, + "label": "Resveratrol/quercetin", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "collagen_or_hyaluronic_acid", + "fieldtype": "Check", + "hidden": 0, + "label": "Collagen or hyaluronic acid", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "omega_3", + "fieldtype": "Check", + "hidden": 0, + "label": "Omega-3 or other anti-inflammatory supplements", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "supplements_other", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Other", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Have you undergone any longevity-related therapies?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "hyperbaric_oxygen_therapy", + "fieldtype": "Check", + "hidden": 0, + "label": "Hyperbaric oxygen therapy", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "ozone_therapy", + "fieldtype": "Check", + "hidden": 0, + "label": "Ozone therapy", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "peptide_therapy", + "fieldtype": "Check", + "hidden": 0, + "label": "Peptide therapy", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "stem_cell_therapy", + "fieldtype": "Check", + "hidden": 0, + "label": "Stem cell therapy", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "cryotherapy_or_cold_exposure_therapy", + "fieldtype": "Check", + "hidden": 0, + "label": "Cryotherapy or cold exposure therapy", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "therapies_other", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Other", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Do you currently monitor any of the following?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "blood_glucose_levels", + "fieldtype": "Check", + "hidden": 0, + "label": "Blood glucose levels", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "heart_rate_variability", + "fieldtype": "Check", + "hidden": 0, + "label": "Heart rate variability (HRV)", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "sleep_quality", + "fieldtype": "Check", + "hidden": 0, + "label": "Sleep quality", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "body_composition", + "fieldtype": "Check", + "hidden": 0, + "label": "Body composition", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "monitor_other", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Other", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Page Break", + "hidden": 0, + "label": "Stress & Emotional Well-being", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "How would you describe your stress levels?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "low", + "fieldtype": "Check", + "hidden": 0, + "label": "Low", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "moderate", + "fieldtype": "Check", + "hidden": 0, + "label": "Moderate", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "high", + "fieldtype": "Check", + "hidden": 0, + "label": "High", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "How do you manage stress?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "meditation_or_mindfulness_practices", + "fieldtype": "Check", + "hidden": 0, + "label": "Meditation or mindfulness practices", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "breathing_exercises", + "fieldtype": "Check", + "hidden": 0, + "label": "Breathing exercises", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "regular_exercise", + "fieldtype": "Check", + "hidden": 0, + "label": "Regular exercise", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "social_engagement_and_relationships", + "fieldtype": "Check", + "hidden": 0, + "label": "Social engagement and relationships", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "professional_therapy_or_coaching", + "fieldtype": "Check", + "hidden": 0, + "label": "Professional therapy or coaching", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "stress_other", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Other", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Page Break", + "hidden": 0, + "label": "Emotional & Mental Well-being", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "How would you describe your overall emotional and mental well-being?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "emotionally_balanced", + "fieldtype": "Check", + "hidden": 0, + "label": "Emotionally balanced", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "occasionally_stressed", + "fieldtype": "Check", + "hidden": 0, + "label": "Occasionally stressed", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "frequently_overwhelmed", + "fieldtype": "Check", + "hidden": 0, + "label": "Frequently overwhelmed", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "struggling_emotionally", + "fieldtype": "Check", + "hidden": 0, + "label": "Struggling emotionally", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "seeking_support", + "fieldtype": "Check", + "hidden": 0, + "label": "Seeking support", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Page Break", + "hidden": 0, + "label": "Social Well-being", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "How would you describe your social connections?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "i_have_strong_and_meaningful_relationships", + "fieldtype": "Check", + "hidden": 0, + "label": "I have strong and meaningful relationships", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "social_connection_check", + "fieldtype": "Check", + "hidden": 0, + "label": "I have some social connections but would like to strengthen them", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "i_often_feel_socially_isolated_or_disconnected", + "fieldtype": "Check", + "hidden": 0, + "label": "I often feel socially isolated or disconnected", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "How often do you engage in social activities or meaningful interactions?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "daily", + "fieldtype": "Check", + "hidden": 0, + "label": "Daily", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "a_few_times_a_week", + "fieldtype": "Check", + "hidden": 0, + "label": "A few times a week", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "a_few_times_a_month", + "fieldtype": "Check", + "hidden": 0, + "label": "A few times a month", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "rarely_or_never", + "fieldtype": "Check", + "hidden": 0, + "label": "Rarely or never", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Page Break", + "hidden": 0, + "label": "Environmental & Toxin Exposure", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Have you been exposed to heavy metals, mold, or other environmental toxins?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "mercury", + "fieldtype": "Check", + "hidden": 0, + "label": "Mercury", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "lead", + "fieldtype": "Check", + "hidden": 0, + "label": "Lead", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "mold_toxicity", + "fieldtype": "Check", + "hidden": 0, + "label": "Mold toxicity", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "toxins_other", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Other", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "", + "fieldtype": "Section Break", + "hidden": 0, + "label": "Do you take any measures to reduce toxin exposure?", + "max_length": 0, + "max_value": 0, + "options": "", + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "air_purification_at_home", + "fieldtype": "Check", + "hidden": 0, + "label": "Air purification at home", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "filtered_water", + "fieldtype": "Check", + "hidden": 0, + "label": "Filtered water", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "organic_diet", + "fieldtype": "Check", + "hidden": 0, + "label": "Organic diet", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "default": "0", + "fieldname": "regular_sauna_use_for_detoxification", + "fieldtype": "Check", + "hidden": 0, + "label": "Regular sauna use for detoxification", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + }, + { + "allow_read_on_all_link_options": 0, + "fieldname": "toxin_measure_other", + "fieldtype": "Small Text", + "hidden": 0, + "label": "Other", + "max_length": 0, + "max_value": 0, + "precision": "", + "read_only": 0, + "reqd": 0, + "show_in_filter": 0 + } + ] +} \ No newline at end of file diff --git a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.py b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.py new file mode 100644 index 0000000..e1a1594 --- /dev/null +++ b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.py @@ -0,0 +1,26 @@ +import frappe + +def get_context(context): + # do your magic here + pass + +@frappe.whitelist(allow_guest=True) +def get_longevity_history_details(email_id): + lead = frappe.db.get_value("Lead", {"email_id": email_id}, ["custom_longevity_history"], as_dict=True) + # if empty lead throw error + if not lead: + frappe.throw("Not found") + + # get the dental history document from the lead + longevity_history = frappe.get_value("Medical History", lead.custom_longevity_history, ["*"], as_dict=True) + return longevity_history + +@frappe.whitelist(allow_guest=True) +def save_longevity_history(doc): + # doc is in json format. Convert it to dict + doc = frappe.parse_json(doc) + # Get the lead from the doc.name assign all values from doc to lead and save + lead = frappe.get_doc("Longevity History", doc.name) + lead.update(doc) + lead.save(ignore_permissions=True) + return lead \ No newline at end of file From bfa175f4621648005ec1562f49e2d4d4dc1023f6 Mon Sep 17 00:00:00 2001 From: Panayiotis Halouvas Date: Fri, 21 Feb 2025 07:58:13 +0000 Subject: [PATCH 04/10] Update button text and success message in patient longevity form --- .../patient_longevity_form_1/patient_longevity_form_1.js | 2 +- .../patient_longevity_form_1/patient_longevity_form_1.json | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.js b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.js index 1a2e18e..a6cc7e8 100644 --- a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.js +++ b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.js @@ -30,7 +30,7 @@ frappe.ready(function () { // Get the redirect button with class name "new-btn" and set the href attribute $('.new-btn').attr('href', href); // Also change the text of the button to "Please complete your medical history here" - $('.new-btn').text('Medical information Form'); + $('.new-btn').text('Longevity information Form'); } $('.submit-btn').on('click', async function (e) { diff --git a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json index dd903fe..7a6f172 100644 --- a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json +++ b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json @@ -33,7 +33,7 @@ "list_title": "Test", "login_required": 0, "max_attachment_size": 0, - "modified": "2025-02-21 09:52:37.655439", + "modified": "2025-02-21 09:54:42.543144", "modified_by": "Administrator", "module": "Swissmedhealth", "name": "patient-longevity-form-1", @@ -44,7 +44,7 @@ "show_attachments": 0, "show_list": 0, "show_sidebar": 0, - "success_message": "Thank you for providing your contact information. We invite you to proceed with the next step of completing your medical information. Please click on the button below to continue. We appreciate your attention to these details, ensuring we can offer you the best possible service.", + "success_message": "Thank you for providing your contact information. We invite you to proceed with the next step of completing your longevity information. Please click on the button below to continue. We appreciate your attention to these details, ensuring we can offer you the best possible service.", "success_title": "", "success_url": "", "title": "Patient Longevity Form", From b8f19056cb1ff51193c6f877b425eb232d248db2 Mon Sep 17 00:00:00 2001 From: Panayiotis Halouvas Date: Fri, 21 Feb 2025 08:31:35 +0000 Subject: [PATCH 05/10] Add functionality to manage Longevity History in lead and patient forms --- swissmedhealth/swissmedhealth/hooks/lead.py | 12 ++++++++++++ .../patient_longevity_form_1.json | 3 ++- .../patient_longevity_form_2.json | 5 +++-- .../patient_longevity_form_2.py | 2 +- 4 files changed, 18 insertions(+), 4 deletions(-) diff --git a/swissmedhealth/swissmedhealth/hooks/lead.py b/swissmedhealth/swissmedhealth/hooks/lead.py index d90c2fa..1959b65 100644 --- a/swissmedhealth/swissmedhealth/hooks/lead.py +++ b/swissmedhealth/swissmedhealth/hooks/lead.py @@ -27,6 +27,11 @@ def onload(self): stress_identification.insert(ignore_permissions=True) self.db_set('custom_stress_identification', stress_identification.name) + if not self.custom_longevity_history: + longevity_history = frappe.new_doc("Longevity History") + longevity_history.insert(ignore_permissions=True) + self.db_set('custom_longevity_history', longevity_history.name) + frappe.db.commit() @@ -93,6 +98,10 @@ def after_insert(doc, method): stress_identification.insert(ignore_permissions=True) doc.db_set('custom_stress_identification', stress_identification.name) + longevity_history = frappe.new_doc("Longevity History") + longevity_history.insert(ignore_permissions=True) + doc.db_set('custom_longevity_history', longevity_history.name) + if not doc.custom_customer_primary_address: address = frappe.new_doc("Address") address.update({ @@ -158,3 +167,6 @@ def after_delete(doc, method): if doc.get('custom_stress_identification'): # delete the customer consent document frappe.delete_doc("Stress Identification", doc.get('custom_stress_identification')) + if doc.get('custom_longevity_history'): + # delete the customer consent document + frappe.delete_doc("Longevity History", doc.get('custom_longevity_history')) diff --git a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json index 7a6f172..bada12e 100644 --- a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json +++ b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json @@ -13,6 +13,7 @@ "banner_image": "/files/registration-form.png", "breadcrumbs": "", "button_label": "Next", + "client_script": "", "condition_json": "[]", "creation": "2025-02-21 08:45:56.906648", "currency": "EUR", @@ -33,7 +34,7 @@ "list_title": "Test", "login_required": 0, "max_attachment_size": 0, - "modified": "2025-02-21 09:54:42.543144", + "modified": "2025-02-21 10:12:34.284587", "modified_by": "Administrator", "module": "Swissmedhealth", "name": "patient-longevity-form-1", diff --git a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.json b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.json index 185390e..ad734d2 100644 --- a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.json +++ b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.json @@ -12,7 +12,7 @@ "apply_document_permissions": 0, "banner_image": "/files/registration-form.png", "button_label": "Next", - "client_script": ".web-form-title,\r\n.ellipsis{\r\n overflow: visible;\r\n word-wrap: break-word;\r\n white-space: wrap;\r\n}\r\n", + "client_script": "", "condition_json": "[]", "creation": "2025-02-21 08:50:38.670437", "currency": "EUR", @@ -25,7 +25,7 @@ "list_columns": [], "login_required": 0, "max_attachment_size": 0, - "modified": "2025-02-21 09:33:02.128324", + "modified": "2025-02-21 10:19:01.036731", "modified_by": "Administrator", "module": "Swissmedhealth", "name": "patient-longevity-form-2", @@ -36,6 +36,7 @@ "show_attachments": 0, "show_list": 0, "show_sidebar": 0, + "success_title": "Thank you", "title": "Patient Longevity Form", "web_form_fields": [ { diff --git a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.py b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.py index e1a1594..860fd8d 100644 --- a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.py +++ b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_2/patient_longevity_form_2.py @@ -12,7 +12,7 @@ def get_longevity_history_details(email_id): frappe.throw("Not found") # get the dental history document from the lead - longevity_history = frappe.get_value("Medical History", lead.custom_longevity_history, ["*"], as_dict=True) + longevity_history = frappe.get_value("Longevity History", lead.custom_longevity_history, ["*"], as_dict=True) return longevity_history @frappe.whitelist(allow_guest=True) From 27ad0bc7078ec093e6737da39ee75f78d9cb2f2c Mon Sep 17 00:00:00 2001 From: Panayiotis Halouvas Date: Sat, 22 Feb 2025 04:30:04 +0000 Subject: [PATCH 06/10] Update lead and patient longevity form configurations to reflect new status options and modify indices --- swissmedhealth/swissmedhealth/custom/lead.json | 18 +++++++++--------- .../patient_longevity_form_1.json | 6 +++--- 2 files changed, 12 insertions(+), 12 deletions(-) diff --git a/swissmedhealth/swissmedhealth/custom/lead.json b/swissmedhealth/swissmedhealth/custom/lead.json index f288a99..3bf203b 100644 --- a/swissmedhealth/swissmedhealth/custom/lead.json +++ b/swissmedhealth/swissmedhealth/custom/lead.json @@ -601,7 +601,7 @@ "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 110, + "idx": 111, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, @@ -1241,7 +1241,7 @@ "hide_border": 0, "hide_days": 0, "hide_seconds": 0, - "idx": 109, + "idx": 110, "ignore_user_permissions": 0, "ignore_xss_filter": 0, "in_global_search": 0, @@ -2669,7 +2669,7 @@ "name": "Lead-custom_status", "no_copy": 1, "non_negative": 0, - "options": "Lead\nPending\nFrom online form\nRegistered Patient\nPending Appointment\nDocumentation sent\nDocumentation received\nConsultation scheduled\nNo action\nInvoice issued\nInvoice Paid\nConsultation\nIssue Medical Proposal\nFollow Up Medical Proposal\nNot Interested\nConverted\nNot contact\nOpportunity", + "options": "Lead\nPending\nFrom online form\nFrom longevity form\nFrom hormonal optimization form\nRegistered Patient\nPending Appointment\nDocumentation sent\nDocumentation received\nConsultation scheduled\nNo action\nInvoice issued\nInvoice Paid\nConsultation\nIssue Medical Proposal\nFollow Up Medical Proposal\nNot Interested\nConverted\nNot contact\nOpportunity", "owner": "Administrator", "permlevel": 0, "placeholder": null, @@ -2830,7 +2830,7 @@ "is_child_table": 0, "link_doctype": "Customer", "link_fieldname": "lead_name", - "modified": "2025-02-21 08:05:09.737547", + "modified": "2025-02-22 06:23:34.054181", "modified_by": "Administrator", "name": "5e28045776", "owner": "Administrator", @@ -3629,7 +3629,7 @@ "_comments": null, "_liked_by": null, "_user_tags": null, - "creation": "2025-02-21 08:05:09.632034", + "creation": "2025-02-22 06:18:47.811904", "default_value": null, "doc_type": "Lead", "docstatus": 0, @@ -3637,7 +3637,7 @@ "field_name": null, "idx": 0, "is_system_generated": 0, - "modified": "2025-02-21 08:05:09.632034", + "modified": "2025-02-22 06:18:47.811904", "modified_by": "Administrator", "module": null, "name": "Lead-main-field_order", @@ -3645,14 +3645,14 @@ "property": "field_order", "property_type": "Data", "row_name": null, - "value": "[\"custom_details\", \"naming_series\", \"first_name\", \"middle_name\", \"last_name\", \"salutation\", \"custom_new_national_id\", \"custom_how_did_you_hear_about_us\", \"custom_consultation_location_preference\", \"custom_creation\", \"custom_dob\", \"custom_is_relative\", \"custom_contact_relative\", \"custom_relative_first_name\", \"custom_relative_last_name\", \"custom_relative_gender\", \"custom_relative_salutation\", \"custom_relative_email_id\", \"custom_relative_phone\", \"custom_relative_country\", \"custom_relation\", \"column_break_1\", \"lead_name\", \"job_title\", \"gender\", \"source\", \"custom_occupation\", \"custom_marital_status\", \"custom_children\", \"custom_number_of_children\", \"custom_pets\", \"col_break123\", \"lead_owner\", \"status\", \"custom_status\", \"customer\", \"custom_lead_type\", \"custom_request_type\", \"type\", \"request_type\", \"custom_gesy\", \"contact_info_tab\", \"custom_national_id\", \"email_id\", \"website\", \"column_break_20\", \"mobile_no\", \"whatsapp_no\", \"column_break_16\", \"phone\", \"phone_ext\", \"organization_section\", \"company_name\", \"no_of_employees\", \"column_break_28\", \"annual_revenue\", \"industry\", \"market_segment\", \"column_break_31\", \"territory\", \"fax\", \"address_section\", \"custom_customer_primary_address\", \"address_html\", \"column_break_38\", \"custom_preferred_communication\", \"custom_street_name\", \"custom_building_name\", \"custom_post_code\", \"city\", \"state\", \"country\", \"column_break2\", \"contact_html\", \"qualification_tab\", \"qualification_status\", \"column_break_64\", \"qualified_by\", \"qualified_on\", \"other_info_tab\", \"campaign_name\", \"company\", \"column_break_22\", \"language\", \"image\", \"title\", \"column_break_50\", \"disabled\", \"unsubscribed\", \"blog_subscriber\", \"custom_classification\", \"custom_classification_type\", \"activities_tab\", \"open_activities_html\", \"all_activities_section\", \"all_activities_html\", \"notes_tab\", \"notes_html\", \"notes\", \"dashboard_tab\", \"custom_sales_team_tab\", \"custom_sales_partner\", \"custom_referral_code\", \"custom_column_break_95uom\", \"custom_commission_rate\", \"custom_history_tab\", \"custom_medical_history\", \"custom_dental_history\", \"custom_stress_identification\", \"longevity_history\", \"custom_customer_consent\"]" + "value": "[\"custom_details\", \"naming_series\", \"first_name\", \"middle_name\", \"last_name\", \"salutation\", \"custom_new_national_id\", \"custom_how_did_you_hear_about_us\", \"custom_consultation_location_preference\", \"custom_creation\", \"custom_dob\", \"custom_is_relative\", \"custom_contact_relative\", \"custom_relative_first_name\", \"custom_relative_last_name\", \"custom_relative_gender\", \"custom_relative_salutation\", \"custom_relative_email_id\", \"custom_relative_phone\", \"custom_relative_country\", \"custom_relation\", \"column_break_1\", \"lead_name\", \"job_title\", \"gender\", \"source\", \"custom_occupation\", \"custom_marital_status\", \"custom_children\", \"custom_number_of_children\", \"custom_pets\", \"col_break123\", \"lead_owner\", \"status\", \"custom_status\", \"customer\", \"custom_lead_type\", \"custom_request_type\", \"type\", \"request_type\", \"custom_gesy\", \"contact_info_tab\", \"custom_national_id\", \"email_id\", \"website\", \"column_break_20\", \"mobile_no\", \"whatsapp_no\", \"column_break_16\", \"phone\", \"phone_ext\", \"organization_section\", \"company_name\", \"no_of_employees\", \"column_break_28\", \"annual_revenue\", \"industry\", \"market_segment\", \"column_break_31\", \"territory\", \"fax\", \"address_section\", \"custom_customer_primary_address\", \"address_html\", \"column_break_38\", \"custom_preferred_communication\", \"custom_street_name\", \"custom_building_name\", \"custom_post_code\", \"city\", \"state\", \"country\", \"column_break2\", \"contact_html\", \"qualification_tab\", \"qualification_status\", \"column_break_64\", \"qualified_by\", \"qualified_on\", \"other_info_tab\", \"campaign_name\", \"company\", \"column_break_22\", \"language\", \"image\", \"title\", \"column_break_50\", \"disabled\", \"unsubscribed\", \"blog_subscriber\", \"custom_classification\", \"custom_classification_type\", \"activities_tab\", \"open_activities_html\", \"all_activities_section\", \"all_activities_html\", \"notes_tab\", \"notes_html\", \"notes\", \"dashboard_tab\", \"custom_sales_team_tab\", \"custom_sales_partner\", \"custom_referral_code\", \"custom_column_break_95uom\", \"custom_commission_rate\", \"custom_history_tab\", \"custom_medical_history\", \"custom_dental_history\", \"custom_stress_identification\", \"custom_longevity_history\", \"custom_customer_consent\"]" }, { "_assign": null, "_comments": null, "_liked_by": null, "_user_tags": null, - "creation": "2025-02-21 08:05:09.770340", + "creation": "2025-02-22 06:23:34.064336", "default_value": null, "doc_type": "Lead", "docstatus": 0, @@ -3660,7 +3660,7 @@ "field_name": null, "idx": 0, "is_system_generated": 0, - "modified": "2025-02-21 08:05:09.770340", + "modified": "2025-02-22 06:23:34.064336", "modified_by": "Administrator", "module": null, "name": "Lead-main-links_order", diff --git a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json index bada12e..66462d1 100644 --- a/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json +++ b/swissmedhealth/swissmedhealth/web_form/patient_longevity_form_1/patient_longevity_form_1.json @@ -34,7 +34,7 @@ "list_title": "Test", "login_required": 0, "max_attachment_size": 0, - "modified": "2025-02-21 10:12:34.284587", + "modified": "2025-02-22 06:24:12.790715", "modified_by": "Administrator", "module": "Swissmedhealth", "name": "patient-longevity-form-1", @@ -67,14 +67,14 @@ }, { "allow_read_on_all_link_options": 0, - "default": "From online form", + "default": "From longevity form", "fieldname": "custom_status", "fieldtype": "Select", "hidden": 1, "label": "Status", "max_length": 0, "max_value": 0, - "options": "Lead\nFrom online form\nDocumentation sent\nDocumentation received\nConsultation recommended\nInvoice issued\nInvoice Paid\nConsultation\nMedical Proposal\nNot Interested\nConverted\nNot contact\nOpportunity", + "options": "Lead\nFrom online form\nFrom longevity form\nDocumentation sent\nDocumentation received\nConsultation recommended\nInvoice issued\nInvoice Paid\nConsultation\nMedical Proposal\nNot Interested\nConverted\nNot contact\nOpportunity", "precision": "", "read_only": 0, "reqd": 1, From 39ccd3b4d1c6ae4e213fd431b926de81d51588d7 Mon Sep 17 00:00:00 2001 From: Panayiotis Halouvas Date: Sat, 22 Feb 2025 04:33:29 +0000 Subject: [PATCH 07/10] Add Longevity History print format and related files --- .../longevity_history/__init__.py | 0 .../longevity_history/longevity_history.html | 0 .../longevity_history/longevity_history.json | 32 + .../patient_form/patient_form.html | 551 +++++++++--------- 4 files changed, 315 insertions(+), 268 deletions(-) create mode 100644 swissmedhealth/swissmedhealth/print_format/longevity_history/__init__.py create mode 100644 swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.html create mode 100644 swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.json diff --git a/swissmedhealth/swissmedhealth/print_format/longevity_history/__init__.py b/swissmedhealth/swissmedhealth/print_format/longevity_history/__init__.py new file mode 100644 index 0000000..e69de29 diff --git a/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.html b/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.html new file mode 100644 index 0000000..e69de29 diff --git a/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.json b/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.json new file mode 100644 index 0000000..7989c88 --- /dev/null +++ b/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.json @@ -0,0 +1,32 @@ +{ + "absolute_value": 0, + "align_labels_right": 0, + "creation": "2025-02-22 06:32:10.444595", + "css": "", + "custom_format": 1, + "default_print_language": "en", + "disabled": 0, + "doc_type": "Lead", + "docstatus": 0, + "doctype": "Print Format", + "font_size": 14, + "html": "

{{ doc.lead_name }}

", + "idx": 0, + "line_breaks": 0, + "margin_bottom": 15.0, + "margin_left": 15.0, + "margin_right": 15.0, + "margin_top": 15.0, + "modified": "2025-02-22 06:32:10.444595", + "modified_by": "Administrator", + "module": "Swissmedhealth", + "name": "Longevity History", + "owner": "Administrator", + "page_number": "Hide", + "print_format_builder": 0, + "print_format_builder_beta": 0, + "print_format_type": "Jinja", + "raw_printing": 0, + "show_section_headings": 0, + "standard": "Yes" +} \ No newline at end of file diff --git a/swissmedhealth/swissmedhealth/print_format/patient_form/patient_form.html b/swissmedhealth/swissmedhealth/print_format/patient_form/patient_form.html index 397d07e..8559601 100644 --- a/swissmedhealth/swissmedhealth/print_format/patient_form/patient_form.html +++ b/swissmedhealth/swissmedhealth/print_format/patient_form/patient_form.html @@ -1,280 +1,295 @@ -
+

Patient Registration Form

-

Patient Registration Form

+{% set gdpr_doc = frappe.get_doc("Customer Consent", doc.custom_customer_consent) %} +{% set acceptance_date = gdpr_doc.acceptance_date %} +Date: {{ acceptance_date }} - {% set gdpr_doc = frappe.get_doc("Customer Consent", doc.custom_customer_consent) %} - {% set acceptance_date = gdpr_doc.acceptance_date %} - Date: {{ acceptance_date }} - - {% set active_doc = doc %} - {% set new_row= {'total': 0} %} - -

Personal Details

- {% for field in active_doc.meta.fields %} - {% set active_value = active_doc.get(field.fieldname) %} - {% if field.print_hide != 1 and field.fieldtype != "Column Break" %} - {% if field.fieldtype == "Heading" or field.fieldtype == "Section Break" %} - {% if new_row.update({'total': 0}) %}{% endif %} - - {% else %} - {% if new_row.total % 2 == 0 %} - - {% endif %} - {% if new_row.update({'total': new_row.total + 1}) %}{% endif %} - {% if field.fieldtype == "Select" and "Yes" in field.options.split("\n") %} - - {% for option in field.options.split("\n") %} - {% if option in ["Yes", "No"] %} - - {% endif %} - {% endfor %} - {% else %} - - {% endif %} - {% endif %} - {% if new_row.total % 2 == 0 %} - - {% endif %} - {% endif %} +{% set active_doc = doc %} +{% set new_row= {'total': 0} %} +
{% if field.label %}{{ field.label }}{% endif %}
{{ field.label }}{% if option == active_value %}{{ option }}{% else %}{{ option }}{% endif %}  - {{ field.label }} - {% if active_value %} - {{ active_value }} - {% else %} - - {% endif %} -
+

Personal Details

+ {% for field in active_doc.meta.fields %} + {% set active_value = active_doc.get(field.fieldname) %} + {% if field.print_hide != 1 and field.fieldtype != "Column Break" %} + {% if field.fieldtype == "Heading" or field.fieldtype == "Section Break" %} + {% if new_row.update({'total': 0}) %}{% endif %} + + + + {% else %} + {% if new_row.total % 2 == 0 %} + + {% endif %} + {% if new_row.update({'total': new_row.total + 1}) %}{% endif %} + {% if field.fieldtype == "Select" and "Yes" in field.options.split("\n") %} + + {% for option in field.options.split("\n") %} + {% if option in ["Yes", "No"] %} + + {% endif %} {% endfor %} -
{% if field.label %}{{ field.label }}{% endif %}
{{ field.label }}{% if option == active_value %}{{ option }}{% else %}{{ option }}{% endif + %} 
+ {% else %} + + {{ field.label }} + {% if active_value %} + {{ active_value }} + {% else %} + + {% endif %} + + {% endif %} + {% endif %} + {% if new_row.total % 2 == 0 %} + + {% endif %} + {% endif %} + {% endfor %} + + +{% set contact_list = frappe.get_list( +"Contact", +filters=[ +["Dynamic Link", "link_doctype", "=", active_doc.doctype or ""], +["Dynamic Link", "link_name", "=", active_doc.name or ""], +["Dynamic Link", "parenttype", "=", "Contact"], +["is_primary_contact", "=", 0], +], +fields=["full_name", "phone"], +order_by="is_primary_contact DESC, `tabContact`.creation ASC", +) %} +{% if contact_list and contact_list[0].phone != active_doc.phone %} + + + + + +
Emergency Contact {{ contact_list[0].full_name }}Phone {{ contact_list[0].phone }}
+{% else %} + + + + + +
Emergency ContactPhone
+{% endif %} - {% set contact_list = frappe.get_list( - "Contact", - filters=[ - ["Dynamic Link", "link_doctype", "=", active_doc.doctype or ""], - ["Dynamic Link", "link_name", "=", active_doc.name or ""], - ["Dynamic Link", "parenttype", "=", "Contact"], - ["is_primary_contact", "=", 0], - ], - fields=["full_name", "phone"], - order_by="is_primary_contact DESC, `tabContact`.creation ASC", - ) %} - {% if contact_list and contact_list[0].phone != active_doc.phone %} - +{% set active_doc = frappe.get_doc("Medical History", doc.custom_medical_history) %} +{% set new_row= {'total': 0} %} +
+

Medical History

+ {% for field in active_doc.meta.fields %} + {% set active_value = active_doc.get(field.fieldname) %} + {% if field.print_hide != 1 and field.fieldtype != "Column Break" %} + {% if field.fieldtype == "Heading" or field.fieldtype == "Section Break" %} + {% if new_row.update({'total': 0}) %}{% endif %} + + + + {% else %} + {% if new_row.total % 2 == 0 %} + + {% endif %} + {% if new_row.update({'total': new_row.total + 1}) %}{% endif %} + {% if field.fieldtype == "Select" and "Yes" in field.options.split("\n") %} + + {% for option in field.options.split("\n") %} + {% if option in ["Yes", "No"] %} + + {% endif %} + {% endfor %} + {% else %} + + {% endif %} + {% endif %} + {% if new_row.total % 2 == 0 %} + + {% endif %} + {% endif %} + {% endfor %} +
{% if field.label %}{{ field.label }}{% endif %}
{{ field.label }}{% if option == active_value %}{{ option }}{% else %}{{ option }}{% endif + %}  + {{ field.label }} + {% if active_value %} + {{ active_value }} + {% else %} + + {% endif %} +
+ +{% set active_doc = frappe.get_doc("Dental History", doc.custom_dental_history) %} +{% set new_row= {'total': 0} %} + +

Dental History

+ {% for field in active_doc.meta.fields %} + {% set active_value = active_doc.get(field.fieldname) %} + {% if field.print_hide != 1 and field.fieldtype != "Column Break" %} + {% if field.fieldtype == "Heading" or field.fieldtype == "Section Break" %} + {% if new_row.update({'total': 0}) %}{% endif %} + + + + {% else %} + {% if new_row.total % 2 == 0 %} + + {% endif %} + {% if new_row.update({'total': new_row.total + 1}) %}{% endif %} + {% if field.fieldtype == "Select" and "Yes" in field.options.split("\n") %} + + {% for option in field.options.split("\n") %} + {% if option in ["Yes", "No"] %} + + {% endif %} + {% endfor %} + {% else %} + + {% endif %} + {% endif %} + {% if new_row.total % 2 == 0 %} + + {% endif %} + {% endif %} + {% endfor %} +
{% if field.label %}{{ field.label }}{% endif %}
{{ field.label }}{% if option == active_value %}{{ option }}{% else %}{{ option }}{% endif + %}  + {{ field.label }} + {% if active_value %} + {{ active_value }} + {% else %} + + {% endif %} +
+ +{% set active_doc = frappe.get_doc("Customer Consent", doc.custom_customer_consent) %} + + - - + -
Emergency Contact {{ contact_list[0].full_name }}Phone {{ contact_list[0].phone }} +

GDPR statement and consent

+
- {% else %} - - - + -
Emergency ContactPhone +

Your personal information:

+

The information collected with this questionnaire will be used by Swissmed Health for medical + services and practices. Your personal data and information will remain with Swissmed Health for us + to provide you with medical services and other related services both at the center and also + potentially to other health centers. This may require that your personal data including medical + records to be shared with other medical service providers for referral purposes as well as other + legal and procedural purposes of the center.

+
- {% endif %} - - {% set active_doc = frappe.get_doc("Medical History", doc.custom_medical_history) %} - {% set new_row= {'total': 0} %} - -

Medical History

- {% for field in active_doc.meta.fields %} - {% set active_value = active_doc.get(field.fieldname) %} - {% if field.print_hide != 1 and field.fieldtype != "Column Break" %} - {% if field.fieldtype == "Heading" or field.fieldtype == "Section Break" %} - {% if new_row.update({'total': 0}) %}{% endif %} - - {% else %} - {% if new_row.total % 2 == 0 %} - - {% endif %} - {% if new_row.update({'total': new_row.total + 1}) %}{% endif %} - {% if field.fieldtype == "Select" and "Yes" in field.options.split("\n") %} - - {% for option in field.options.split("\n") %} - {% if option in ["Yes", "No"] %} - - {% endif %} - {% endfor %} + + + + + + + + +   {% endif %} - {% endif %} - {% if new_row.total % 2 == 0 %} - - {% endif %} - {% endif %} - {% endfor %} -
{% if field.label %}{{ field.label }}{% endif %}
{{ field.label }}{% if option == active_value %}{{ option }}{% else %}{{ option }}{% endif %} 
+

Your statement and confirmation

+
+

Yes

+
+

No

+
+

I understand and accept that the Center has the right to approve or reject my registration + application at any point in time.

+
+

+ {% if active_doc.accept_registration == "Yes" %} + ✔️ {% else %} -

- {{ field.label }} - {% if active_value %} - {{ active_value }} - {% else %} - - {% endif %} -
- - {% set active_doc = frappe.get_doc("Dental History", doc.custom_dental_history) %} - {% set new_row= {'total': 0} %} - -

Dental History

- {% for field in active_doc.meta.fields %} - {% set active_value = active_doc.get(field.fieldname) %} - {% if field.print_hide != 1 and field.fieldtype != "Column Break" %} - {% if field.fieldtype == "Heading" or field.fieldtype == "Section Break" %} - {% if new_row.update({'total': 0}) %}{% endif %} - - {% else %} - {% if new_row.total % 2 == 0 %} - - {% endif %} - {% if new_row.update({'total': new_row.total + 1}) %}{% endif %} - {% if field.fieldtype == "Select" and "Yes" in field.options.split("\n") %} - - {% for option in field.options.split("\n") %} - {% if option in ["Yes", "No"] %} - - {% endif %} - {% endfor %} +

+ + +   {% endif %} - {% endif %} - {% if new_row.total % 2 == 0 %} - - {% endif %} - {% endif %} - {% endfor %} -
{% if field.label %}{{ field.label }}{% endif %}
{{ field.label }}{% if option == active_value %}{{ option }}{% else %}{{ option }}{% endif %}  +

+ {% if active_doc.accept_registration == "No" %} + X {% else %} -

- {{ field.label }} - {% if active_value %} - {{ active_value }} - {% else %} - - {% endif %} -
- - {% set active_doc = frappe.get_doc("Customer Consent", doc.custom_customer_consent) %} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
-

GDPR statement and consent

-
-

Your personal information:

-

The information collected with this questionnaire will be used by Swissmed Health for medical services and practices. Your personal data and information will remain with Swissmed Health for us to provide you with medical services and other related services both at the center and also potentially to other health centers. This may require that your personal data including medical records to be shared with other medical service providers for referral purposes as well as other legal and procedural purposes of the center.

-
-

Your statement and confirmation

-
-

Yes

-
-

No

-
-

I understand and accept that the Center has the right to approve or reject my registration application at any point in time.

-
-

- {% if active_doc.accept_registration == "Yes" %} - ✔️ - {% else %} -   - {% endif %} -

-
-

- {% if active_doc.accept_registration == "No" %} - X - {% else %} -   - {% endif %} -

-
-

I confirm that to the best of my knowledge the information that I have given on this registration form/questionnaire is accurate. Additionally, I understand that it is my responsibility to inform and update the Center as to any changes to my personal data and information.

-
-

- {% if active_doc.accept_personal_data == "Yes" %} - ✔️ - {% else %} -   - {% endif %} -

-
-

- {% if active_doc.accept_personal_data == "No" %} - X - {% else %} -   - {% endif %} -

-
-

I hereby give my consent to the Center to communicate with me via phone, email or other means for updates as to new medical programs, upcoming lectures and conferences as well as Center news.

-
-

- {% if active_doc.accept_communication == "Yes" %} - ✔️ - {% else %} -   - {% endif %} -

-
-

- {% if active_doc.accept_communication == "No" %} - X - {% else %} -   - {% endif %} -

-
-

- {% if active_doc.signature %} - - {% endif %} -

-
-

Signature

-

Date: {{ active_doc.acceptance_date or ''}}

-
-

For Internal Use

-
Received by:Previous medical records requested
System entry dateMRN Number
-
+

+ + + + +

I confirm that to the best of my knowledge the information that I have given on this registration + form/questionnaire is accurate. Additionally, I understand that it is my responsibility to inform + and update the Center as to any changes to my personal data and information.

+ + +

+ {% if active_doc.accept_personal_data == "Yes" %} + ✔️ + {% else %} +   + {% endif %} +

+ + +

+ {% if active_doc.accept_personal_data == "No" %} + X + {% else %} +   + {% endif %} +

+ + + + +

I hereby give my consent to the Center to communicate with me via phone, email or other means for + updates as to new medical programs, upcoming lectures and conferences as well as Center news.

+ + +

+ {% if active_doc.accept_communication == "Yes" %} + ✔️ + {% else %} +   + {% endif %} +

+ + +

+ {% if active_doc.accept_communication == "No" %} + X + {% else %} +   + {% endif %} +

+ + + + +

+ {% if active_doc.signature %} + + {% endif %} +

+ + + + +

Signature

+

Date: {{ active_doc.acceptance_date or ''}}

+ + + + +

For Internal Use

+ + + + Received by: + Previous medical records requested + + + System entry date + MRN Number + + + \ No newline at end of file From e498f10250359c411bd051c8d4731ad15433b0af Mon Sep 17 00:00:00 2001 From: Panayiotis Halouvas Date: Sat, 22 Feb 2025 04:34:11 +0000 Subject: [PATCH 08/10] Add HTML template for Patient Longevity History print format --- .../longevity_history/longevity_history.html | 75 +++++++++++++++++++ 1 file changed, 75 insertions(+) diff --git a/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.html b/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.html index e69de29..b62f342 100644 --- a/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.html +++ b/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.html @@ -0,0 +1,75 @@ +

Patient Longevity History

+ +{% set gdpr_doc = frappe.get_doc("Customer Consent", doc.custom_customer_consent) %} +{% set acceptance_date = gdpr_doc.acceptance_date %} +Date: {{ acceptance_date }} + +{% set active_doc = doc %} +{% set new_row= {'total': 0} %} + +

Personal Details

+ {% for field in active_doc.meta.fields %} + {% set active_value = active_doc.get(field.fieldname) %} + {% if field.print_hide != 1 and field.fieldtype != "Column Break" %} + {% if field.fieldtype == "Heading" or field.fieldtype == "Section Break" %} + {% if new_row.update({'total': 0}) %}{% endif %} + + + + {% else %} + {% if new_row.total % 2 == 0 %} + + {% endif %} + {% if new_row.update({'total': new_row.total + 1}) %}{% endif %} + {% if field.fieldtype == "Select" and "Yes" in field.options.split("\n") %} + + {% for option in field.options.split("\n") %} + {% if option in ["Yes", "No"] %} + + {% endif %} + {% endfor %} + {% else %} + + {% endif %} + {% endif %} + {% if new_row.total % 2 == 0 %} + + {% endif %} + {% endif %} + {% endfor %} +
{% if field.label %}{{ field.label }}{% endif %}
{{ field.label }}{% if option == active_value %}{{ option }}{% else %}{{ option }}{% endif + %}  + {{ field.label }} + {% if active_value %} + {{ active_value }} + {% else %} + + {% endif %} +
+ +{% set contact_list = frappe.get_list( +"Contact", +filters=[ +["Dynamic Link", "link_doctype", "=", active_doc.doctype or ""], +["Dynamic Link", "link_name", "=", active_doc.name or ""], +["Dynamic Link", "parenttype", "=", "Contact"], +["is_primary_contact", "=", 0], +], +fields=["full_name", "phone"], +order_by="is_primary_contact DESC, `tabContact`.creation ASC", +) %} +{% if contact_list and contact_list[0].phone != active_doc.phone %} + + + + + +
Emergency Contact {{ contact_list[0].full_name }}Phone {{ contact_list[0].phone }}
+{% else %} + + + + + +
Emergency ContactPhone
+{% endif %} \ No newline at end of file From 13dcac65a49c5dc30030b3d30d8aab14a0809ff4 Mon Sep 17 00:00:00 2001 From: Panayiotis Halouvas Date: Sat, 22 Feb 2025 04:37:31 +0000 Subject: [PATCH 09/10] Add Longevity History and Customer Consent sections to print format --- .../longevity_history/longevity_history.html | 179 +++++++++++++++++- 1 file changed, 178 insertions(+), 1 deletion(-) diff --git a/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.html b/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.html index b62f342..a8310af 100644 --- a/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.html +++ b/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.html @@ -72,4 +72,181 @@

Personal Details

Phone -{% endif %} \ No newline at end of file +{% endif %} + +{% set active_doc = frappe.get_doc("Longevity History", doc.custom_longevity_history) %} +{% set new_row= {'total': 0} %} + +

Longevity History

+ {% for field in active_doc.meta.fields %} + {% set active_value = active_doc.get(field.fieldname) %} + {% if field.print_hide != 1 and field.fieldtype != "Column Break" %} + {% if field.fieldtype == "Heading" or field.fieldtype == "Section Break" %} + {% if new_row.update({'total': 0}) %}{% endif %} + + + + {% else %} + {% if new_row.total % 2 == 0 %} + + {% endif %} + {% if new_row.update({'total': new_row.total + 1}) %}{% endif %} + {% if field.fieldtype == "Select" and "Yes" in field.options.split("\n") %} + + {% for option in field.options.split("\n") %} + {% if option in ["Yes", "No"] %} + + {% endif %} + {% endfor %} + {% else %} + + {% endif %} + {% endif %} + {% if new_row.total % 2 == 0 %} + + {% endif %} + {% endif %} + {% endfor %} +
{% if field.label %}{{ field.label }}{% endif %}
{{ field.label }}{% if option == active_value %}{{ option }}{% else %}{{ option }}{% endif + %}  + {{ field.label }} + {% if active_value %} + {{ active_value }} + {% else %} + + {% endif %} +
+ +{% set active_doc = frappe.get_doc("Customer Consent", doc.custom_customer_consent) %} + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+

GDPR statement and consent

+
+

Your personal information:

+

The information collected with this questionnaire will be used by Swissmed Health for medical + services and practices. Your personal data and information will remain with Swissmed Health for us + to provide you with medical services and other related services both at the center and also + potentially to other health centers. This may require that your personal data including medical + records to be shared with other medical service providers for referral purposes as well as other + legal and procedural purposes of the center.

+
+

Your statement and confirmation

+
+

Yes

+
+

No

+
+

I understand and accept that the Center has the right to approve or reject my registration + application at any point in time.

+
+

+ {% if active_doc.accept_registration == "Yes" %} + ✔️ + {% else %} +   + {% endif %} +

+
+

+ {% if active_doc.accept_registration == "No" %} + X + {% else %} +   + {% endif %} +

+
+

I confirm that to the best of my knowledge the information that I have given on this registration + form/questionnaire is accurate. Additionally, I understand that it is my responsibility to inform + and update the Center as to any changes to my personal data and information.

+
+

+ {% if active_doc.accept_personal_data == "Yes" %} + ✔️ + {% else %} +   + {% endif %} +

+
+

+ {% if active_doc.accept_personal_data == "No" %} + X + {% else %} +   + {% endif %} +

+
+

I hereby give my consent to the Center to communicate with me via phone, email or other means for + updates as to new medical programs, upcoming lectures and conferences as well as Center news.

+
+

+ {% if active_doc.accept_communication == "Yes" %} + ✔️ + {% else %} +   + {% endif %} +

+
+

+ {% if active_doc.accept_communication == "No" %} + X + {% else %} +   + {% endif %} +

+
+

+ {% if active_doc.signature %} + + {% endif %} +

+
+

Signature

+

Date: {{ active_doc.acceptance_date or ''}}

+
+

For Internal Use

+
Received by:Previous medical records requested
System entry dateMRN Number
\ No newline at end of file From 56bc5c3e1b38add6fafb6a143d8e1d269f4014e2 Mon Sep 17 00:00:00 2001 From: Panayiotis Halouvas Date: Sat, 22 Feb 2025 04:48:22 +0000 Subject: [PATCH 10/10] Refactor longevity history HTML template to improve structure and readability --- .../longevity_history/longevity_history.html | 35 ++++++++++--------- 1 file changed, 19 insertions(+), 16 deletions(-) diff --git a/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.html b/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.html index a8310af..53db834 100644 --- a/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.html +++ b/swissmedhealth/swissmedhealth/print_format/longevity_history/longevity_history.html @@ -91,24 +91,27 @@

Longevity History

{% endif %} {% if new_row.update({'total': new_row.total + 1}) %}{% endif %} - {% if field.fieldtype == "Select" and "Yes" in field.options.split("\n") %} - {{ field.label }} - {% for option in field.options.split("\n") %} - {% if option in ["Yes", "No"] %} - {% if option == active_value %}{{ option }}{% else %}{{ option }}{% endif - %}  - {% endif %} - {% endfor %} - {% else %} - - {{ field.label }} - {% if active_value %} - {{ active_value }} + {% if field.fieldtype == "Select" and "Yes" in field.options.split("\n") %} + {{ field.label }} + {% for option in field.options.split("\n") %} + {% if option in ["Yes", "No"] %} + {% if option == active_value %}{{ option }}{% else %}{{ option }}{% endif + %}  + {% endif %} + {% endfor %} + {% elif field.fieldtype == "Check" %} + {{ field.label }} + {% if active_value %}✔️{% else %} {% endif %} {% else %} - + + {{ field.label }} + {% if active_value %} + {{ active_value }} + {% else %} + + {% endif %} + {% endif %} - - {% endif %} {% endif %} {% if new_row.total % 2 == 0 %}