Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FM2-513: Observations classed as LabSet to be categorised in the 'laboratory' category #430

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
38 changes: 38 additions & 0 deletions api/src/main/resources/liquibase.xml
Expand Up @@ -656,6 +656,25 @@
</sql>
</changeSet>

<changeSet id="add_labSet_as_laboratory_observation_category_20220928" author="ruhanga" dbms="mysql,mariadb">
<preConditions onFail="MARK_RAN" onError="WARN">
<and>
<tableExists tableName="fhir_observation_category_map"/>
<!-- default UUID for LabSet -->
<sqlCheck expectedResult="1">
select 1 from concept_class where uuid = '8d492026-c2cc-11de-8d13-0010c6dffd0f'
</sqlCheck>
</and>
</preConditions>
<sql><![CDATA[
insert into fhir_observation_category_map (concept_class_id, observation_category, creator, date_created, uuid)
select concept_class_id, 'laboratory', 1, now(), uuid()
from concept_class
where uuid = '8d492026-c2cc-11de-8d13-0010c6dffd0f'
]]>
</sql>
</changeSet>

<changeSet id="add_default_observation_categories_20200930" author="ibacher" dbms="postgresql">
<preConditions onFail="MARK_RAN" onError="WARN">
<and>
Expand Down Expand Up @@ -701,6 +720,25 @@
</sql>
</changeSet>

<changeSet id="add_labSet_as_laboratory_observation_category_20220928" author="ruhanga" dbms="postgresql">
<preConditions onFail="MARK_RAN" onError="WARN">
<and>
<tableExists tableName="fhir_observation_category_map"/>
<!-- default UUID for LabSet -->
<sqlCheck expectedResult="1">
select 1 from concept_class where uuid = '8d492026-c2cc-11de-8d13-0010c6dffd0f'
</sqlCheck>
</and>
</preConditions>
<sql><![CDATA[
insert into fhir_observation_category_map (concept_class_id, observation_category, creator, date_created, uuid)
select concept_class_id, 'laboratory', 1, now(), uuid_in(overlay(overlay(md5(random()::text || ':' || clock_timestamp()::text) placing '4' from 13) placing to_hex(floor(random()*(11-8+1) + 8)::int)::text from 17)::cstring)
from concept_class
where uuid = '8d492026-c2cc-11de-8d13-0010c6dffd0f'
]]>
</sql>
</changeSet>

<changeSet id="add_fhir_duration_unit_map_20200930" author="ibacher">
<preConditions onFail="MARK_RAN" onError="WARN">
<not>
Expand Down