-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
0703d95
commit 879349a
Showing
223 changed files
with
42,298 additions
and
67 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,140 @@ | ||
{ | ||
"jobs": [{ | ||
"name": "Visits", | ||
"type": "customSql", | ||
"readerSql": "SELECT visit.visit_id AS visit_id, visit.patient_id AS patient_id, visit_type.uuid AS visit_type_uuid, visit_type.name as visit_type, visit.date_started AS date_started, visit.date_stopped AS date_stopped, visit.indication_concept_id AS indication_concept_id, visit.location_id AS location_id, visit.voided AS visit_voided, visit.uuid AS visit_uuid, person.person_id AS person_id, row_number() over(partition by visit.patient_id) as number_occurences, person.gender AS gender, person.birthdate AS birthdate, person.birthdate_estimated AS birthdate_estimated, CASE WHEN datediff(visit.date_started, person.birthdate)/365 < 1 THEN '0 - 1' WHEN datediff(visit.date_started, person.birthdate)/365 BETWEEN 1 AND 4 THEN '1 - 4' WHEN datediff(visit.date_started, person.birthdate)/365 BETWEEN 4 AND 9 THEN '5 - 9' WHEN datediff(visit.date_started, person.birthdate)/365 BETWEEN 10 AND 14 THEN '10 - 14' WHEN datediff(visit.date_started, person.birthdate)/365 BETWEEN 15 AND 19 THEN '15 - 19' WHEN datediff(visit.date_started, person.birthdate)/365 BETWEEN 20 AND 24 THEN '20 - 24' WHEN datediff(visit.date_started, person.birthdate)/365 > 24 THEN '25+' ELSE 'Invalid birthdate' END AS 'age_at_visit_group_profile_1', datediff(visit.date_started, person.birthdate)/365 as age_at_visit, person.dead AS dead, person.death_date AS death_date, person.cause_of_death AS cause_of_death, person.voided AS person_voided, person.uuid AS person_uuid FROM visit LEFT JOIN visit_type visit_type ON visit.visit_type_id = visit_type.visit_type_id LEFT JOIN person person ON visit.patient_id = person.person_id", | ||
"tableName": "visits", | ||
"incrementalUpdateConfig": { | ||
"updateOn": "visit_id", | ||
"eventCategory": "visit", | ||
"openmrsTableName": "visit" | ||
} | ||
}, | ||
{ | ||
"name": "Concepts", | ||
"type": "customSql", | ||
"readerSql": "SELECT `concept`.`concept_id` AS `concept_id`, `concept_reference_source`.`name` AS `Concept Mapping Source`, `concept_reference_term`.`code` AS `Concept Mapping Code`, `concept_reference_term`.`name` AS `Concept Mapping Name`, `concept_name`.`name` AS `name`, `concept_name`.`locale` AS `locale`, `concept_name`.`locale_preferred` AS `locale_preferred`, `concept`.`retired` AS `retired`, `concept`.`uuid` AS `uuid` FROM `concept` LEFT JOIN `concept_reference_map` `concept_reference_map` ON `concept`.`concept_id` = `concept_reference_map`.`concept_id` LEFT JOIN `concept_reference_term` `concept_reference_term` ON `concept_reference_map`.`concept_reference_term_id` = `concept_reference_term`.`concept_reference_term_id` LEFT JOIN `concept_reference_source` `concept_reference_source` ON `concept_reference_term`.`concept_source_id` = `concept_reference_source`.`concept_source_id` LEFT JOIN `concept_name` `concept_name` ON `concept`.`concept_id` = `concept_name`.`concept_id`", | ||
"tableName": "concepts", | ||
"incrementalUpdateConfig": { | ||
"updateOn": "concept_id", | ||
"eventCategory": "concept", | ||
"openmrsTableName": "concept" | ||
} | ||
}, | ||
{ | ||
"name": "base_obs_query", | ||
"type": "customSql", | ||
"readerSql": "SELECT `obs`.`obs_id` AS `obs_id`, `obs`.`person_id` AS `person_id`, `concept_concept_name`.`name` AS `concept_name`,`obs`.`concept_id` AS `concept_id`, `obs`.`obs_group_id` AS `obs_group_id`, `obs`.`accession_number` AS `accession_number`, `obs`.`form_namespace_and_path` AS `form_namespace_and_path`, `obs`.`value_coded` AS `value_coded`, `value_concept_name`.`name` AS `value_coded_name`, `obs`.`value_coded_name_id` AS `value_coded_name_id`, `obs`.`value_drug` AS `value_drug`, `obs`.`value_datetime` AS `value_datetime`, `obs`.`value_numeric` AS `value_numeric`, `obs`.`value_modifier` AS `value_modifier`, `obs`.`value_text` AS `value_text`, `obs`.`value_complex` AS `value_complex`, `obs`.`comments` AS `comments`, `obs`.`creator` AS `creator`, `obs`.`date_created` AS `date_created`, `obs`.`voided` AS `obs_voided`, `obs`.`void_reason` AS `obs_void_reason`, `obs`.`previous_version` AS `previous_version`, `encounter`.`encounter_id` AS `encounter_id`, `encounter`.`voided` AS `voided_2`, `visit`.`visit_id` AS `visit_id`, `visit`.`date_started` AS `visit_date_started`, `visit`.`date_stopped` AS `visit_date_stopped`, `visit`.`location_id` AS `location_id`, `encounter_type`.`name` AS `encounter_type_name`, `encounter_type`.`description` AS `encounter_type_description`, `encounter_type`.`retired` AS `encounter_type_retired`, `encounter_type`.`uuid` AS `encounter_type_uuid`, `visit_type`.`name` AS `visit_type_name`, `visit_type`.`retired` AS `visit_type_retired`, `visit_type`.`uuid` AS `visit_type_uuid`, `location`.`name` AS `location_name`, `location`.`address1` AS `location_address1`, `location`.`address2` AS `location_address2`, `location`.`city_village` AS `location_city_village`, `location`.`state_province` AS `location_state_province`, `location`.`postal_code` AS `location_postal_code`, `location`.`country` AS `location_country`, `location`.`retired` AS `location_retired`, `location`.`uuid` AS `location_uuid` FROM `obs` LEFT JOIN `concept_name` `value_concept_name` ON `obs`.`value_coded` = `value_concept_name`.`concept_id` AND `obs`.`value_coded` IS NOT NULL LEFT JOIN `encounter` `encounter` ON `obs`.`encounter_id` = `encounter`.`encounter_id` LEFT JOIN `visit` `visit` ON `encounter`.`visit_id` = `visit`.`visit_id` LEFT JOIN `encounter_type` `encounter_type` ON `encounter`.`encounter_type` = `encounter_type`.`encounter_type_id` LEFT JOIN `visit_type` `visit_type` ON `visit`.`visit_type_id` = `visit_type`.`visit_type_id` LEFT JOIN `location` `location` ON `obs`.`location_id` = `location`.`location_id` LEFT JOIN `concept_name` `concept_concept_name` ON `obs`.`concept_id` = `concept_concept_name`.`concept_id` WHERE `concept_concept_name`.`locale` = 'fr' AND `concept_concept_name`.`locale_preferred` = 'true' AND ( `value_concept_name`.`locale` IS NULL OR `value_concept_name`.`locale` = 'fr') AND (`value_concept_name`.`locale_preferred` IS NULL OR `value_concept_name`.`locale_preferred` = 'true' ) ", | ||
"tableName": "base_obs_query" | ||
}, | ||
{ | ||
"name": "Patients", | ||
"type": "patients", | ||
"chunkSizeToRead": "500" | ||
}, | ||
{ | ||
"name": "Appointments", | ||
"type": "appointments", | ||
"chunkSizeToRead": "500", | ||
"groupedJobConfigs": [{ | ||
"tableName": "appointment_service_default", | ||
"columnsToIgnore": [] | ||
}] | ||
}, | ||
{ | ||
"name": "Location", | ||
"type": "location", | ||
"chunkSizeToRead": "500" | ||
}, | ||
{ | ||
"name": "Person", | ||
"type": "person", | ||
"chunkSizeToRead": "500", | ||
"groupedJobConfigs": [{ | ||
"tableName": "person_attributes", | ||
"columnsToIgnore": [ | ||
"primaryContact", | ||
"secondaryContact", | ||
"primaryRelative", | ||
"familyNameLocal", | ||
"givenNameLocal", | ||
"middleNameLocal" | ||
] | ||
}, | ||
{ | ||
"tableName": "person_details_default", | ||
"columnsToIgnore": [ | ||
"prefix", | ||
"given_name", | ||
"middle_name", | ||
"family_name_prefix", | ||
"family_name", | ||
"family_name2", | ||
"family_name_suffix" | ||
] | ||
} | ||
] | ||
}, | ||
{ | ||
"name": "Visits And Encounters", | ||
"type": "visitsAndEncounters", | ||
"chunkSizeToRead": "500" | ||
}, | ||
{ | ||
"name": "Medication And Orders", | ||
"type": "medicationAndOrders", | ||
"chunkSizeToRead": "500", | ||
"groupedJobConfigs": [{ | ||
"tableName": "medication_data_default", | ||
"columnsToIgnore": [ | ||
"instructions", | ||
"stop_notes" | ||
] | ||
}] | ||
}, | ||
{ | ||
"name": "Diagnoses And Conditions", | ||
"type": "diagnosesAndConditions", | ||
"chunkSizeToRead": "500" | ||
}, | ||
{ | ||
"name": "MetaData Dictionary", | ||
"type": "metadata", | ||
"conceptReferenceSource": "" | ||
} | ||
], | ||
"procedures": [{ | ||
"name": "Discharge Date Procedure", | ||
"sourceFilePath": "classpath:procedureSql/dischargeDateProc.sql" | ||
}, | ||
{ | ||
"name": "Age Group Procedure", | ||
"sourceFilePath": "classpath:procedureSql/ageGroupProc.sql" | ||
} | ||
], | ||
"views": [{ | ||
"name": "patient_visits_encounters_view", | ||
"sourceFilePath": "classpath:viewSql/patientVisitsEncountersView.sql" | ||
}, | ||
{ | ||
"name": "appointment_admin_panel_view", | ||
"sql": "SELECT * FROM appointment_service_default LEFT OUTER JOIN service_availability_default USING (appointment_service_id, service_name)" | ||
}, | ||
{ | ||
"name": "patient_details_view", | ||
"sourceFilePath": "classpath:viewSql/patientDetailsView.sql" | ||
}, | ||
{ | ||
"name": "patient_information_view", | ||
"sourceFilePath": "classpath:viewSql/patientInformationView.sql" | ||
}, | ||
{ | ||
"name": "patient_appointment_view", | ||
"sourceFilePath": "classpath:viewSql/patientAppointmentView.sql" | ||
}, | ||
{ | ||
"name": "patient_diagnosis_condition_view", | ||
"sourceFilePath": "classpath:viewSql/patientDiagnosisConditionView.sql" | ||
} | ||
] | ||
} |
79 changes: 79 additions & 0 deletions
79
configs/bahmni_config/bahmni-mart/odoo_queries/sales_orders.sql
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,79 @@ | ||
CREATE TABLE temporary_table as ( | ||
WITH IndexedCosts AS ( | ||
SELECT | ||
Row_Number() OVER ( | ||
ORDER BY | ||
write_date | ||
) ix, | ||
write_date, | ||
cost, | ||
product_id | ||
FROM | ||
product_price_history | ||
), | ||
RangedCosts AS ( | ||
SELECT | ||
CASE WHEN IC.ix = 1 THEN CAST( | ||
'1900-01-01' AS timestamp without time zone | ||
) ELSE IC.write_date END DateFrom, | ||
CAST( | ||
COALESCE(IC2.write_date, now()) AS timestamp without time zone | ||
) DateTo, | ||
IC.cost, | ||
IC.product_id | ||
FROM | ||
IndexedCosts IC | ||
LEFT JOIN IndexedCosts IC2 ON IC.ix = IC2.ix - 1 | ||
) | ||
SELECT | ||
"company"."name" AS "company_name", | ||
"public"."sale_order_line"."id" AS "id", | ||
"public"."sale_order_line"."order_id" AS "order_id", | ||
"order"."date_order" AS "date_order", | ||
"public"."sale_order_line"."name" AS "name", | ||
"public"."sale_order_line"."product_uom_qty" AS "product_uom_qty", | ||
"product_uom"."name" AS "unit_of_measure", | ||
"public"."sale_order_line"."price_unit" AS "unit_price", | ||
RC.cost as "cost_at_date", | ||
"currency"."name" AS "currency_name", | ||
"price_list"."name" AS "price_list_name", | ||
"public"."sale_order_line"."qty_to_invoice" AS "qty_to_invoice", | ||
"public"."sale_order_line"."qty_invoiced" AS "qty_invoiced", | ||
"public"."sale_order_line"."discount" AS "discount", | ||
"public"."sale_order_line"."price_reduce" AS "price_reduce", | ||
"payment_term"."name" AS "payment_term_name", | ||
"public"."sale_order_line"."qty_delivered" AS "qty_delivered", | ||
"public"."sale_order_line"."price_reduce_taxinc" AS "price_reduce_taxinc", | ||
"public"."sale_order_line"."price_total" AS "price_total", | ||
"public"."sale_order_line"."invoice_status" AS "invoice_status", | ||
"public"."sale_order_line"."expiry_date" AS "expiry_date", | ||
"public"."sale_order_line"."dispensed" AS "dispensed", | ||
"order"."invoice_status" AS "order_invoice_status", | ||
"order"."care_setting" AS "care_setting", | ||
"order"."discount_type" AS "discount_type", | ||
"order"."discount" AS "order_discount", | ||
"public"."sale_order_line"."external_order_id" AS "order_uuid", | ||
"order_partner"."name" AS "partner_name", | ||
"order_partner"."display_name" AS "partner_display_name", | ||
"order_partner"."uuid" AS "partner_uuid", | ||
"product"."uuid" AS "product_uuid" | ||
FROM | ||
"public"."sale_order_line" | ||
LEFT JOIN "public"."sale_order" "order" ON "public"."sale_order_line"."order_id" = "order"."id" | ||
LEFT JOIN "public"."res_partner" "order_partner" ON "public"."sale_order_line"."order_partner_id" = "order_partner"."id" | ||
LEFT JOIN "public"."product_uom" "product_uom" ON "public"."sale_order_line"."product_uom" = "product_uom"."id" | ||
LEFT JOIN "public"."res_currency" "currency" ON "public"."sale_order_line"."currency_id" = "currency"."id" | ||
LEFT JOIN "public"."product_product" "product" ON "public"."sale_order_line"."product_id" = "product"."id" | ||
LEFT OUTER JOIN "public"."product_pricelist" "price_list" ON "order"."pricelist_id" = "price_list"."id" | ||
LEFT OUTER JOIN "public"."res_company" "company" ON "public"."sale_order_line"."company_id" = "company"."id" | ||
LEFT OUTER JOIN "public"."account_payment_term" "payment_term" ON "order"."payment_term_id" = "payment_term"."id" | ||
LEFT OUTER JOIN RangedCosts RC ON (product.id = RC.product_id) | ||
AND ( | ||
"order"."date_order" > RC.DateFrom | ||
) | ||
AND ( | ||
"order"."date_order" <= RC.DateTo | ||
) | ||
ORDER BY | ||
"public"."sale_order_line"."id" | ||
) |
Large diffs are not rendered by default.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
{ | ||
"id": "bahmni.admin", | ||
"extensionPoints": [ | ||
{ | ||
"id": "org.bahmni.admin.dashboard", | ||
"description": "Bahmni Admin Page" | ||
} | ||
] | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
{ | ||
"auditLog":{ | ||
"id": "bahmni.admin.auditLog", | ||
"extensionPointId": "org.bahmni.admin.dashboard", | ||
"type": "link", | ||
"extensionParams": { | ||
}, | ||
"label": "Audit Log", | ||
"url": "#/auditLog", | ||
"icon": "fa-eye", | ||
"order": 1, | ||
"requiredPrivilege": "app:admin" | ||
}, | ||
"orderSet":{ | ||
"id": "bahmni.admin.orderSet", | ||
"extensionPointId": "org.bahmni.admin.dashboard", | ||
"type": "link", | ||
"extensionParams": { | ||
}, | ||
"label": "Order Set", | ||
"url": "#/ordersetdashboard", | ||
"icon": "fa-upload", | ||
"order": 1, | ||
"requiredPrivilege": "app:admin" | ||
}, | ||
"beds":{ | ||
"id": "bahmni.admin.adt", | ||
"extensionPointId": "org.bahmni.admin.dashboard", | ||
"type": "link", | ||
"extensionParams": { | ||
}, | ||
"label": "Beds", | ||
"url": "/openmrs/owa/bedmanagement/admissionLocations.html", | ||
"icon": "icon-bahmni-inpatient", | ||
"order": 1, | ||
"requiredPrivilege": "app:admin" | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,86 @@ | ||
{ | ||
"id": "bahmni.adt.admission", | ||
"extensionPoints": [ | ||
{ | ||
"id": "org.bahmni.adt.admit.action", | ||
"description": "Bahmni Patient Admission Action" | ||
}, | ||
{ | ||
"id": "org.bahmni.adt.transfer.action", | ||
"description": "Bahmni Patient Transfer Action" | ||
}, | ||
{ | ||
"id": "org.bahmni.adt.discharge.action", | ||
"description": "Bahmni Patient Discharge Action" | ||
}, | ||
{ | ||
"id": "org.bahmni.patient.search", | ||
"description": "Bahmni patient search, lookup Page" | ||
} | ||
], | ||
"contextModel": [ | ||
"patientUuid", | ||
"encounterUuid", | ||
"visitUuid" | ||
], | ||
"config" : { | ||
"diagnosisStatus": "Inactive", | ||
"onAdmissionForwardTo": "#/patient/{{patientUuid}}/visit/{{visitUuid}}/encounter/{{encounterUuid}}/bed", | ||
"onTransferForwardTo": "#/patient/{{patientUuid}}/visit/{{visitUuid}}/encounter/{{encounterUuid}}/bed", | ||
"onDischargeForwardTo": "#/patient/search", | ||
"defaultVisitType": "Inpatient", | ||
"maxPatientsPerBed" : 2, | ||
"dashboard":{ | ||
"translationKey": "DASHBOARD_TAB_GENERAL_KEY", | ||
"conceptName": "Adt Notes", | ||
"sections": { | ||
"vitals":{ | ||
"translationKey":"DASHBOARD_TITLE_VITALS_KEY", | ||
"type": "vitals", | ||
"displayOrder": 0, | ||
"isObservation": true, | ||
"dashboardConfig": { | ||
"conceptNames": ["Vitals"], | ||
"numberOfVisits": 2 | ||
} | ||
}, | ||
"disposition":{ | ||
"translationKey":"DASHBOARD_TITLE_DISPOSITION_KEY", | ||
"type": "disposition", | ||
"numberOfVisits": 1, | ||
"displayOrder": 1 | ||
}, | ||
"diagnosis":{ | ||
"translationKey":"DASHBOARD_TITLE_DIAGNOSIS_KEY", | ||
"type": "diagnosis", | ||
"numberOfVisits": 1, | ||
"showDetailsButton":true, | ||
"displayOrder": 2 | ||
}, | ||
"patientInformation":{ | ||
"translationKey": "DASHBOARD_TITLE_PATIENT_INFORMATION_KEY", | ||
"type": "patientInformation", | ||
"displayOrder": 3, | ||
"patientAttributes": ["caste", "class", "education", "occupation", "debt", "distanceFromCenter", "isUrban", "cluster","RationCard", "familyIncome"], | ||
"addressFields": ["address1", "address2", "cityVillage", "countyDistrict"] | ||
}, | ||
"admissionDetails":{ | ||
"translationKey":"DASHBOARD_TITLE_ADMISSION_DETAILS_KEY", | ||
"type":"admissionDetails", | ||
"displayOrder": 4 | ||
}, | ||
"navigationLinksControl":{ | ||
"translationKey":"DASHBOARD_TITLE_NAVIGATION_LINKS_CONTROL_KEY", | ||
"type": "navigationLinksControl", | ||
"displayOrder": 5, | ||
"showLinks" : ["home", "visit", "registration", "inpatient", "enrolment", "visitAttribute"] | ||
}, | ||
"conditions": { | ||
"translationKey":"CONDITION_LIST_DISPLAY_CONTROL_TITLE", | ||
"type": "conditionsList", | ||
"displayOrder": 6 | ||
} | ||
}} | ||
|
||
} | ||
} |
Oops, something went wrong.