diff --git a/configuration/appframework/patient_dashboard_extension.json b/configuration/appframework/patient_dashboard_extension.json new file mode 100644 index 0000000..30b550b --- /dev/null +++ b/configuration/appframework/patient_dashboard_extension.json @@ -0,0 +1,20 @@ +[ + { + "id": "ces.overallActions.downloadFrontPage", + "extensionPointId": "patientDashboard.overallActions", + "type": "link", + "label": "ces.downloadFrontPage", + "url": "module/pihcore/downloadReport.form?reportUuid=8be6802f-74a6-11f0-96a7-2ed2f846759c&patientId={{patient.patientId}}", + "icon": "fas fa-fw fa-download", + "order": 50 + }, + { + "id": "ces.overallActions.downloadClinicalHistory", + "extensionPointId": "patientDashboard.overallActions", + "type": "link", + "label": "ces.downloadClinicalHistory", + "url": "module/pihcore/downloadReport.form?reportUuid=004edb19-a3ac-11f0-9112-b688702e33e5&patientId={{patient.patientId}}", + "icon": "fas fa-fw fa-download", + "order": 51 + } +] diff --git a/configuration/appframework/system_administration_extension.json b/configuration/appframework/system_administration_extension.json deleted file mode 100644 index 891b2a9..0000000 --- a/configuration/appframework/system_administration_extension.json +++ /dev/null @@ -1,11 +0,0 @@ -[ - { - "id": "ces.overallActions.downloadFrontPage", - "extensionPointId": "patientDashboard.overallActions", - "type": "link", - "label": "ces.downloadFrontPage", - "url": "module/pihcore/downloadReport.form?reportUuid=8be6802f-74a6-11f0-96a7-2ed2f846759c&patientId={{patient.patientId}}", - "icon": "fas fa-fw fa-download", - "order": 50 - } -] diff --git a/configuration/messageproperties/metadata_en.properties b/configuration/messageproperties/metadata_en.properties index e2d633e..95bc114 100644 --- a/configuration/messageproperties/metadata_en.properties +++ b/configuration/messageproperties/metadata_en.properties @@ -8,4 +8,5 @@ coreapps.Diagnosis.Certainty.CONFIRMED=First time mirebalais.dispensing.medicationInstructions=Administration Instructions ces.dispensing.frequency=Frecuencia ces.dispensing.timing.dosing=ej: #tablets, #ml -ces.downloadFrontPage=Download Front Sheet \ No newline at end of file +ces.downloadFrontPage=Download Front Sheet +ces.downloadClinicalHistory=Download Clinical History \ No newline at end of file diff --git a/configuration/messageproperties/metadata_es.properties b/configuration/messageproperties/metadata_es.properties index 90fe78a..b1dc327 100644 --- a/configuration/messageproperties/metadata_es.properties +++ b/configuration/messageproperties/metadata_es.properties @@ -8,4 +8,5 @@ pih.app.6cceab45-756f-427b-b2da-0e469d4a87e0.programStatistics.title=Tablero de mirebalais.dispensing.medicationInstructions=Instrucciones (v\u00EDa de administraci\u00F3n, indicaciones para uso) ces.dispensing.frequency=Frecuencia ces.dispensing.timing.dosing=ej: #tabletas, #ml -ces.downloadFrontPage=Descargar Hoja Frontal \ No newline at end of file +ces.downloadFrontPage=Descargar Hoja Frontal +ces.downloadClinicalHistory=Descargar Historia Clínica \ No newline at end of file diff --git a/configuration/reports/reportdescriptors/dataexports/historiaClinicaSinglePatient.yml b/configuration/reports/reportdescriptors/dataexports/historiaClinicaSinglePatient.yml new file mode 100644 index 0000000..74e29c2 --- /dev/null +++ b/configuration/reports/reportdescriptors/dataexports/historiaClinicaSinglePatient.yml @@ -0,0 +1,18 @@ +key: "historiaClinicaSinglePatient" +uuid: "004edb19-a3ac-11f0-9112-b688702e33e5" +name: "Historia Clínica" +description: "Historia Clínica" +parameters: + - key: "patientId" + type: "java.lang.Integer" + label: "PID" +datasets: + - key: "historiaClinica" + type: "sql" + config: "sql/historiaClinica.sql" +designs: + - type: "excel" + template: "templates/historiaClinica.xls" + properties: + repeatingSections: "sheet:1,dataset:historiaClinica" + diff --git a/configuration/reports/reportdescriptors/dataexports/sql/historiaClinica.sql b/configuration/reports/reportdescriptors/dataexports/sql/historiaClinica.sql index 6aff6ec..db659dc 100644 --- a/configuration/reports/reportdescriptors/dataexports/sql/historiaClinica.sql +++ b/configuration/reports/reportdescriptors/dataexports/sql/historiaClinica.sql @@ -1,5 +1,6 @@ --- set @startDate = '2025-06-01'; --- set @endDate = '2025-12-31'; +-- set @startDate = '2025-06-01'; +-- set @endDate = '2025-12-31'; +-- set @patientId = 2337; set SESSION group_concat_max_len = 1000000; @@ -14,7 +15,8 @@ create temporary table temp_hc encounter_id int(11), patient_id int(11), visit_id int(11), -encounter_datetime datetime, +encounter_date date, +sheet_name varchar(100), location_id int(11), location_name varchar(255), full_facility_name text, @@ -109,13 +111,15 @@ breast_exam_obs_group_id int(11), breast_exam_comments text ); -insert into temp_hc (encounter_id, patient_id, location_id, encounter_datetime, entry_date, visit_id) -select encounter_id, patient_id, location_id, encounter_datetime, date(date_created), visit_id +insert into temp_hc (encounter_id, patient_id, location_id, encounter_date, entry_date, visit_id) +select encounter_id, patient_id, location_id, date(encounter_datetime), date(date_created), visit_id FROM encounter e where e.voided = 0 AND e.encounter_type in (@historiaClinicaEnc) -AND date(e.encounter_datetime) >= @startDate -AND date(e.encounter_datetime) <= @endDate; +AND ( + (@patientId is not null and e.patient_id = @patientId) or + (@patientId is null and date(e.encounter_datetime) >= @startDate and date(e.encounter_datetime) <= @endDate) +); create index temp_hc_ei on temp_hc(encounter_id); create index temp_hc_pi on temp_hc(patient_id); @@ -642,8 +646,14 @@ set @rr = concept_from_mapping('PIH','5242'); update temp_hc set rr = obs_value_numeric_from_temp_using_concept_id(vitals_encounter_id, @rr); +-- sheet name +update temp_hc set sheet_name = if(@patientId is null, concat(lastname, '-'), ''); +update temp_hc set sheet_name = concat(sheet_name, date_format(encounter_date, '%Y-%m-%d'), ' ', encounter_id); + select encounter_id, +encounter_date, +sheet_name, full_facility_name, location_name, lastname, diff --git a/configuration/reports/reportdescriptors/dataexports/templates/historiaClinica.xls b/configuration/reports/reportdescriptors/dataexports/templates/historiaClinica.xls index a8c1444..01ccf86 100644 Binary files a/configuration/reports/reportdescriptors/dataexports/templates/historiaClinica.xls and b/configuration/reports/reportdescriptors/dataexports/templates/historiaClinica.xls differ