Skip to content

Commit

Permalink
O3-2446: parse and load queue priority concept
Browse files Browse the repository at this point in the history
  • Loading branch information
cioan committed Jan 18, 2024
1 parent 9c7c4b0 commit 2cd95c0
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,9 @@ public class QueueLineProcessor extends BaseLineProcessor<Queue> {

protected static String HEADER_SERVICE = "service";

protected static String HEADER_STATUS_CONCEPT_SET = "statusConceptSet";
protected static String HEADER_STATUS_CONCEPT_SET = "status concept set";

protected static String HEADER_PRIORITY_CONCEPT_SET = "priority concept set";

protected static String HEADER_LOCATION = "location";

Expand Down Expand Up @@ -55,6 +57,14 @@ public Queue fill(Queue queue, CsvLine line) throws IllegalArgumentException {
queue.setStatusConceptSet(null);
}
}
if (line.containsHeader(HEADER_PRIORITY_CONCEPT_SET)) {
String priorityConceptSet = line.getString(HEADER_PRIORITY_CONCEPT_SET);
if (StringUtils.isNotBlank(priorityConceptSet)) {
queue.setPriorityConceptSet(Utils.fetchConcept(priorityConceptSet, conceptService));
} else {
queue.setPriorityConceptSet(null);
}
}
if (line.containsHeader(HEADER_LOCATION)) {
String location = line.getString(HEADER_LOCATION);
if (StringUtils.isNotBlank(location)) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ public void load_shouldLoadAccordingToCsvFiles() throws Exception {
Assert.assertEquals("Queue with custom statuses", queue.getDescription());
Assert.assertEquals(2001, queue.getService().getConceptId().intValue());
Assert.assertEquals(2003, queue.getStatusConceptSet().getConceptId().intValue());
Assert.assertEquals("Triage queue priorities", queue.getPriorityConceptSet().getName().getName());
Assert.assertEquals("Xanadu", queue.getLocation().getName());
}
}
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
Uuid,Void/Retire,Name,Description,Service,StatusConceptSet,Location
2a0e0eee-6888-11ee-ab8d-0242ac120002,,Revised Queue,Revised Description,68b910bd-298c-4ecf-a632-661ae2f446op,,Xanadu
288db1cc-688a-11ee-ab8d-0242ac120002,,New Queue,New Description,Triage,,167ce20c-4785-4285-9119-d197268f7f4a
4856c1c1-c9b3-4a7e-8669-4220051ab640,,Triage Queue,Queue with custom statuses,67b910bd-298c-4ecf-a632-661ae2f446op,1d2a73ca-20aa-4218-b4d2-043024a9156e,Xanadu
Uuid,Void/Retire,Name,Description,Service,Status Concept Set,Priority Concept Set,Location
2a0e0eee-6888-11ee-ab8d-0242ac120002,,Revised Queue,Revised Description,68b910bd-298c-4ecf-a632-661ae2f446op,,,Xanadu
288db1cc-688a-11ee-ab8d-0242ac120002,,New Queue,New Description,Triage,,,167ce20c-4785-4285-9119-d197268f7f4a
4856c1c1-c9b3-4a7e-8669-4220051ab640,,Triage Queue,Queue with custom statuses,67b910bd-298c-4ecf-a632-661ae2f446op,1d2a73ca-20aa-4218-b4d2-043024a9156e,24932838-60ca-44e8-840f-4184b368643c,Xanadu
2 changes: 2 additions & 0 deletions api/src/test/resources/testdata/test-queues.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,12 @@
<concept concept_id="2001" retired="false" is_set="false" creator="1" date_created="2022-02-02 14:40:00.0" uuid="67b910bd-298c-4ecf-a632-661ae2f446op"/>
<concept concept_id="2002" retired="false" is_set="false" creator="1" date_created="2022-03-08 15:40:00.0" uuid="68b910bd-298c-4ecf-a632-661ae2f446op"/>
<concept concept_id="2003" retired="false" is_set="false" creator="1" date_created="2024-01-16 15:40:00.0" uuid="1d2a73ca-20aa-4218-b4d2-043024a9156e"/>
<concept concept_id="2004" retired="false" is_set="false" creator="1" date_created="2024-01-18 05:40:00.0" uuid="24932838-60ca-44e8-840f-4184b368643c"/>
<concept_name concept_name_id="893" concept_id="2000" name="Queue Service" locale="en" creator="1" date_created="2022-02-02 14:40:00.0" voided="0" uuid="9cp62348-5bf2-4050-b824-0aa009436ed6" concept_name_type="FULLY_SPECIFIED" locale_preferred="0"/>
<concept_name concept_name_id="210" concept_id="2001" name="Triage" locale="en" creator="1" date_created="2022-02-02 14:40:00.0" voided="0" uuid="9i667348-5bf2-4050-b824-0aa009436kl0" concept_name_type="FULLY_SPECIFIED" locale_preferred="0"/>
<concept_name concept_name_id="211" concept_id="2002" name="Consultation" locale="en" creator="1" date_created="2022-02-02 14:40:00.0" voided="0" uuid="5t747348-5bf2-4050-b824-0aa009436kl0" concept_name_type="FULLY_SPECIFIED" locale_preferred="0"/>
<concept_name concept_name_id="212" concept_id="2003" name="Triage statuses" locale="en" creator="1" date_created="2024-01-15 14:40:00.0" voided="0" uuid="9b6d5a44-47b0-4ed2-873b-5b317721ca9a" concept_name_type="FULLY_SPECIFIED" locale_preferred="0"/>
<concept_name concept_name_id="213" concept_id="2004" name="Triage queue priorities" locale="en" creator="1" date_created="2024-01-16 14:40:00.0" voided="0" uuid="9f2af84d-5e4c-43d9-bdde-fea4a3f15744" concept_name_type="FULLY_SPECIFIED" locale_preferred="0"/>
<concept_set concept_set_id="389000" concept_set="2000" concept_id="2001" sort_weight="0" date_created="2022-02-02 14:40:00.0" creator="1" uuid="470b910bd-298c-4ecf-a632-661ae2f886bf"/>
<concept_set concept_set_id="389001" concept_set="2000" concept_id="2002" sort_weight="0" date_created="2022-03-08 15:50:00.0" creator="1" uuid="380b910bd-298c-4ecf-a632-661ae2f886bf"/>

Expand Down

0 comments on commit 2cd95c0

Please sign in to comment.