Skip to content

Commit

Permalink
fix: FHIRVersion changed from data to link
Browse files Browse the repository at this point in the history
setup data fixes
patch renamed
  • Loading branch information
akurungadam authored and akashkrishna619 committed Feb 8, 2024
1 parent 9f59f60 commit 4f6f264
Show file tree
Hide file tree
Showing 6 changed files with 103 additions and 24 deletions.
9 changes: 9 additions & 0 deletions healthcare/healthcare/doctype/code_system/code_system.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@
// For license information, please see license.txt

frappe.ui.form.on('Code System', {
setup: function(frm) {
frm.set_query("version", function () {
return {
"filters": {
"code_system": "FHIRVersion",
}
};
});
}
});
9 changes: 9 additions & 0 deletions healthcare/healthcare/doctype/code_value/code_value.js
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,13 @@
// For license information, please see license.txt

frappe.ui.form.on('Code Value', {
setup: function(frm) {
frm.set_query("version", function () {
return {
"filters": {
"code_system": "FHIRVersion",
}
};
});
}
});
2 changes: 1 addition & 1 deletion healthcare/patches.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,5 @@ healthcare.patches.v15_0.setup_service_request
healthcare.patches.v15_0.rename_field_medical_department_in_appoitment_type_service_item
healthcare.patches.v15_0.set_default_dynamic_link_dt_for_appointment_type_service_item
healthcare.patches.v15_0.set_allow_booking_for_in_appointment_type
healthcare.patches.v15_0.setup_non_fhir_code_systems
healthcare.patches.v15_0.setup_basic_code_systems
healthcare.patches.v15_0.setup_diagnostic_module_codes
6 changes: 6 additions & 0 deletions healthcare/patches/v15_0/setup_basic_code_systems.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
from healthcare.setup import setup_fhir_code_systems, setup_non_fhir_code_systems


def execute():
setup_non_fhir_code_systems()
setup_fhir_code_systems()
5 changes: 0 additions & 5 deletions healthcare/patches/v15_0/setup_non_fhir_code_systems.py

This file was deleted.

96 changes: 78 additions & 18 deletions healthcare/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -1070,6 +1070,34 @@ def setup_non_fhir_code_systems():
insert_record(code_systems)


def setup_fhir_code_systems():
code_systems = [
{
"doctype": "Code System",
"is_fhir_defined": 1,
"uri": "http:https://hl7.org/fhir/FHIR-version",
"code_system": _("FHIRVersion"),
"description": _("All published FHIR Versions."),
"oid": "2.16.840.1.113883.4.642.4.1310",
"experimental": 0,
"immutable": 0,
"custom": 0,
},
{
"doctype": "Code System",
"is_fhir_defined": 1,
"uri": "http:https://hl7.org/fhir/publication-status",
"code_system": _("PublicationStatus"),
"description": _("The lifecycle status of an artifact."),
"oid": "22.16.840.1.113883.4.642.3.3",
"experimental": 0,
"immutable": 1,
"custom": 0,
},
]
insert_record(code_systems)


def setup_diagnostic_module_codes():
records = []

Expand All @@ -1087,7 +1115,7 @@ def get_diagnostic_module_code_systems():
"doctype": "Code System",
"is_fhir_defined": 0,
"uri": "http:https://terminology.hl7.org/CodeSystem/observation-category",
"code_system": _("Observation Category"),
"code_system": _("ObservationCategory"),
"description": _("Observation Category codes."),
"oid": "2.16.840.1.113883.4.642.1.1125",
"experimental": 1,
Expand All @@ -1098,7 +1126,7 @@ def get_diagnostic_module_code_systems():
"doctype": "Code System",
"is_fhir_defined": 1,
"uri": "http:https://hl7.org/fhir/observation-status",
"code_system": _("Observation Status"),
"code_system": _("ObservationStatus"),
"description": _("Codes providing the status of an observation."),
"version": "5.0.0",
"oid": "2.16.840.1.113883.4.642.4.401",
Expand All @@ -1117,71 +1145,89 @@ def get_observation_category_codes():
"code_system": _("Observation Category"),
"code_value": "social-history",
"display": _("Social History"),
"definition": _("Social History Observations define the patient's occupational, personal (e.g., lifestyle), social, familial, and environmental history and health risk factors that may impact the patient's health."),
"definition": _(
"Social History Observations define the patient's occupational, personal (e.g., lifestyle), social, familial, and environmental history and health risk factors that may impact the patient's health."
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-category",
},
{
"doctype": "Code Value",
"code_system": _("Observation Category"),
"code_value": "vital-signs",
"display": _("Vital Signs"),
"definition": _("Clinical observations measure the body's basic functions such as blood pressure, heart rate, respiratory rate, height, weight, body mass index, head circumference, pulse oximetry, temperature, and body surface area."),
"definition": _(
"Clinical observations measure the body's basic functions such as blood pressure, heart rate, respiratory rate, height, weight, body mass index, head circumference, pulse oximetry, temperature, and body surface area."
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-category",
},
{
"doctype": "Code Value",
"code_system": _("Observation Category"),
"code_value": "imaging",
"display": _("Imaging"),
"definition": _("Observations generated by imaging. The scope includes observations regarding plain x-ray, ultrasound, CT, MRI, angiography, echocardiography, and nuclear medicine."),
"definition": _(
"Observations generated by imaging. The scope includes observations regarding plain x-ray, ultrasound, CT, MRI, angiography, echocardiography, and nuclear medicine."
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-category",
},
{
"doctype": "Code Value",
"code_system": _("Observation Category"),
"code_value": "laboratory",
"display": _("Laboratory"),
"definition": _("The results of observations generated by laboratories. Laboratory results are typically generated by laboratories providing analytic services in areas such as chemistry, hematology, serology, histology, cytology, anatomic pathology (including digital pathology), microbiology, and/or virology. These observations are based on analysis of specimens obtained from the patient and submitted to the laboratory."),
"definition": _(
"The results of observations generated by laboratories. Laboratory results are typically generated by laboratories providing analytic services in areas such as chemistry, hematology, serology, histology, cytology, anatomic pathology (including digital pathology), microbiology, and/or virology. These observations are based on analysis of specimens obtained from the patient and submitted to the laboratory."
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-category",
},
{
"doctype": "Code Value",
"code_system": _("Observation Category"),
"code_value": "procedure",
"display": _("Procedure"),
"definition": _("Observations generated by other procedures. This category includes observations resulting from interventional and non-interventional procedures excluding laboratory and imaging (e.g., cardiology catheterization, endoscopy, electrodiagnostics, etc.). Procedure results are typically generated by a clinician to provide more granular information about component observations made during a procedure. An example would be when a gastroenterologist reports the size of a polyp observed during a colonoscopy."),
"definition": _(
"Observations generated by other procedures. This category includes observations resulting from interventional and non-interventional procedures excluding laboratory and imaging (e.g., cardiology catheterization, endoscopy, electrodiagnostics, etc.). Procedure results are typically generated by a clinician to provide more granular information about component observations made during a procedure. An example would be when a gastroenterologist reports the size of a polyp observed during a colonoscopy."
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-category",
},
{
"doctype": "Code Value",
"code_system": _("Observation Category"),
"code_value": "survey",
"display": _("Survey"),
"definition": _("Assessment tool/survey instrument observations (e.g., Apgar Scores, Montreal Cognitive Assessment (MoCA))."),
"definition": _(
"Assessment tool/survey instrument observations (e.g., Apgar Scores, Montreal Cognitive Assessment (MoCA))."
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-category",
},
{
"doctype": "Code Value",
"code_system": _("Observation Category"),
"code_value": "exam",
"display": _("Exam"),
"definition": _("Observations generated by physical exam findings including direct observations made by a clinician and use of simple instruments and the result of simple maneuvers performed directly on the patient's body."),
"definition": _(
"Observations generated by physical exam findings including direct observations made by a clinician and use of simple instruments and the result of simple maneuvers performed directly on the patient's body."
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-category",
},
{
"doctype": "Code Value",
"code_system": _("Observation Category"),
"code_value": "therapy",
"display": _("Therapy"),
"definition": _("Observations generated by non-interventional treatment protocols (e.g. occupational, physical, radiation, nutritional and medication therapy)"),
"definition": _(
"Observations generated by non-interventional treatment protocols (e.g. occupational, physical, radiation, nutritional and medication therapy)"
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-category",
},
{
"doctype": "Code Value",
"code_system": _("Observation Category"),
"code_value": "activity",
"display": _("Activity"),
"definition": _("Observations that measure or record any bodily activity that enhances or maintains physical fitness and overall health and wellness. Not under direct supervision of practitioner such as a physical therapist. (e.g., laps swum, steps, sleep data)"),
"definition": _(
"Observations that measure or record any bodily activity that enhances or maintains physical fitness and overall health and wellness. Not under direct supervision of practitioner such as a physical therapist. (e.g., laps swum, steps, sleep data)"
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-category",
},
]
Expand All @@ -1195,7 +1241,9 @@ def get_observation_status_codes():
"code_system": _("Observation Status"),
"code_value": "registered",
"display": _("Registered"),
"definition": _("Observations that measure or record any bodily activity that enhances or maintains physical fitness and overall health and wellness. Not under direct supervision of practitioner such as a physical therapist. (e.g., laps swum, steps, sleep data.)"),
"definition": _(
"Observations that measure or record any bodily activity that enhances or maintains physical fitness and overall health and wellness. Not under direct supervision of practitioner such as a physical therapist. (e.g., laps swum, steps, sleep data.)"
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-status",
"version": "6.0.0-cibuild",
},
Expand All @@ -1204,7 +1252,9 @@ def get_observation_status_codes():
"code_system": _("Observation Status"),
"code_value": "preliminary",
"display": _("Preliminary"),
"definition": _("This is an initial or interim observation: data may be incomplete or unverified."),
"definition": _(
"This is an initial or interim observation: data may be incomplete or unverified."
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-status",
"version": "6.0.0-cibuild",
},
Expand All @@ -1222,7 +1272,9 @@ def get_observation_status_codes():
"code_system": _("Observation Status"),
"code_value": "amended",
"display": _("Amended"),
"definition": _("Subsequent to being Final, the observation has been modified subsequent. This includes updates/new information and corrections."),
"definition": _(
"Subsequent to being Final, the observation has been modified subsequent. This includes updates/new information and corrections."
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-status",
"version": "6.0.0-cibuild",
},
Expand All @@ -1231,7 +1283,9 @@ def get_observation_status_codes():
"code_system": _("Observation Status"),
"code_value": "corrected",
"display": _("Corrected"),
"definition": _("Subsequent to being Final, the observation has been modified to correct an error in the test result."),
"definition": _(
"Subsequent to being Final, the observation has been modified to correct an error in the test result."
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-status",
"version": "6.0.0-cibuild",
},
Expand All @@ -1240,7 +1294,9 @@ def get_observation_status_codes():
"code_system": _("Observation Status"),
"code_value": "cancelled",
"display": _("Cancelled"),
"definition": _("The observation is unavailable because the measurement was not started or not completed (also sometimes called 'aborted')."),
"definition": _(
"The observation is unavailable because the measurement was not started or not completed (also sometimes called 'aborted')."
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-status",
"version": "6.0.0-cibuild",
},
Expand All @@ -1249,7 +1305,9 @@ def get_observation_status_codes():
"code_system": _("Observation Status"),
"code_value": "entered-in-error",
"display": _("Entered in Error"),
"definition": _("The observation has been withdrawn following previous final release. This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be 'cancelled' rather than 'entered-in-error'.)."),
"definition": _(
"The observation has been withdrawn following previous final release. This electronic record should never have existed, though it is possible that real-world decisions were based on it. (If real-world activity has occurred, the status should be 'cancelled' rather than 'entered-in-error'.)."
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-status",
"version": "6.0.0-cibuild",
},
Expand All @@ -1258,7 +1316,9 @@ def get_observation_status_codes():
"code_system": _("Observation Status"),
"code_value": "unknown",
"display": _("Unknown"),
"definition": _("The authoring/source system does not know which of the status values currently applies for this observation. Note: This concept is not to be used for 'other' - one of the listed statuses is presumed to apply, but the authoring/source system does not know which."),
"definition": _(
"The authoring/source system does not know which of the status values currently applies for this observation. Note: This concept is not to be used for 'other' - one of the listed statuses is presumed to apply, but the authoring/source system does not know which."
),
"official_url": "http:https://hl7.org/fhir/ValueSet/observation-status",
"version": "6.0.0-cibuild",
},
Expand Down

0 comments on commit 4f6f264

Please sign in to comment.