Skip to content

Commit 36cee47

Browse files
committed
adds missing start Task resources with draft status
1 parent 91fd738 commit 36cee47

File tree

5 files changed

+95
-6
lines changed

5 files changed

+95
-6
lines changed

src/main/java/dev/dsf/bpe/AllowListProcessPluginDefinition.java

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -54,9 +54,13 @@ public Map<String, List<String>> getFhirResourcesByProcessId()
5454
var sDown = "fhir/StructureDefinition/dsf-task-download-allow-list.xml";
5555
var sUp = "fhir/StructureDefinition/dsf-task-update-allow-list.xml";
5656

57+
var tDown = "fhir/Task/dsf-task-download-allow-list.xml";
58+
var tUp = "fhir/Task/dsf-task-update-allow-list.xml";
59+
5760
var v = "fhir/ValueSet/dsf-allow-list.xml";
5861

59-
return Map.of(ConstantsAllowList.PROCESS_NAME_FULL_DOWNLOAD_ALLOW_LIST, Arrays.asList(c, aDown, sDown, v),
60-
ConstantsAllowList.PROCESS_NAME_FULL_UPDATE_ALLOW_LIST, Arrays.asList(c, aUp, sUp, v));
62+
return Map.of(ConstantsAllowList.PROCESS_NAME_FULL_DOWNLOAD_ALLOW_LIST,
63+
Arrays.asList(c, aDown, sDown, tDown, v), ConstantsAllowList.PROCESS_NAME_FULL_UPDATE_ALLOW_LIST,
64+
Arrays.asList(c, aUp, sUp, tUp, v));
6165
}
6266
}
Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,49 @@
1+
<Task xmlns="http://hl7.org/fhir">
2+
<meta>
3+
<profile value="http://dsf.dev/fhir/StructureDefinition/task-download-allow-list|#{version}" />
4+
</meta>
5+
<identifier>
6+
<system value="http://dsf.dev/sid/task-identifier"/>
7+
<value value="http://dsf.dev/bpe/Process/downloadAllowList/#{version}/task-download-allow-list"/>
8+
</identifier>
9+
<instantiatesCanonical value="http://dsf.dev/bpe/Process/downloadAllowList|#{version}" />
10+
<status value="draft" />
11+
<intent value="order" />
12+
<authoredOn value="#{date}" />
13+
<requester>
14+
<type value="Organization" />
15+
<identifier>
16+
<system value="http://dsf.dev/sid/organization-identifier" />
17+
<value value="#{organization}" />
18+
</identifier>
19+
</requester>
20+
<restriction>
21+
<recipient>
22+
<type value="Organization" />
23+
<identifier>
24+
<system value="http://dsf.dev/sid/organization-identifier" />
25+
<value value="#{organization}" />
26+
</identifier>
27+
</recipient>
28+
</restriction>
29+
<input>
30+
<type>
31+
<coding>
32+
<system value="http://dsf.dev/fhir/CodeSystem/bpmn-message" />
33+
<code value="message-name" />
34+
</coding>
35+
</type>
36+
<valueString value="downloadAllowListMessage" />
37+
</input>
38+
<input>
39+
<type>
40+
<coding>
41+
<system value="http://dsf.dev/fhir/CodeSystem/allow-list" />
42+
<code value="allow_list" />
43+
</coding>
44+
</type>
45+
<valueReference>
46+
<reference value="https://foo.bar/fhir/Bundle/example-id" />
47+
</valueReference>
48+
</input>
49+
</Task>
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
<Task xmlns="http://hl7.org/fhir">
2+
<meta>
3+
<profile value="http://dsf.dev/fhir/StructureDefinition/task-update-allow-list|#{version}"/>
4+
</meta>
5+
<identifier>
6+
<system value="http://dsf.dev/sid/task-identifier"/>
7+
<value value="http://dsf.dev/bpe/Process/updateAllowList/#{version}/task-update-allow-list"/>
8+
</identifier>
9+
<instantiatesCanonical value="http://dsf.dev/bpe/Process/updateAllowList|#{version}"/>
10+
<status value="draft" />
11+
<intent value="order" />
12+
<authoredOn value="#{date}" />
13+
<requester>
14+
<type value="Organization" />
15+
<identifier>
16+
<system value="http://dsf.dev/sid/organization-identifier" />
17+
<value value="#{organization}" />
18+
</identifier>
19+
</requester>
20+
<restriction>
21+
<recipient>
22+
<type value="Organization" />
23+
<identifier>
24+
<system value="http://dsf.dev/sid/organization-identifier" />
25+
<value value="#{organization}" />
26+
</identifier>
27+
</recipient>
28+
</restriction>
29+
<input>
30+
<type>
31+
<coding>
32+
<system value="http://dsf.dev/fhir/CodeSystem/bpmn-message" />
33+
<code value="message-name" />
34+
</coding>
35+
</type>
36+
<valueString value="updateAllowListMessage" />
37+
</input>
38+
</Task>

src/test/java/dev/dsf/bpe/UpdateAllowListProcessPluginDefinitionTest.java

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ public void testResourceLoading()
2020

2121
var download = resourcesByProcessId.get(ConstantsAllowList.PROCESS_NAME_FULL_DOWNLOAD_ALLOW_LIST);
2222
assertNotNull(download);
23-
assertEquals(4, download.stream().filter(this::exists).count());
23+
assertEquals(5, download.stream().filter(this::exists).count());
2424

2525
var update = resourcesByProcessId.get(ConstantsAllowList.PROCESS_NAME_FULL_UPDATE_ALLOW_LIST);
2626
assertNotNull(update);
27-
assertEquals(4, update.stream().filter(this::exists).count());
27+
assertEquals(5, update.stream().filter(this::exists).count());
2828
}
2929

3030
private boolean exists(String file)

src/test/java/dev/dsf/bpe/start/UpdateAllowList3DicTtpExampleStarter.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@
66
import org.hl7.fhir.r4.model.StringType;
77
import org.hl7.fhir.r4.model.Task;
88

9-
import ca.uhn.fhir.context.FhirContext;
109
import dev.dsf.bpe.AllowListProcessPluginDefinition;
1110
import dev.dsf.bpe.ConstantsAllowList;
1211
import dev.dsf.bpe.v1.constants.CodeSystems;
@@ -20,7 +19,6 @@ public class UpdateAllowList3DicTtpExampleStarter
2019
// password
2120
public static void main(String[] args) throws Exception
2221
{
23-
System.out.println(FhirContext.forR4().newXmlParser().encodeResourceToString(task()));
2422
ExampleStarter.forServer(args, ConstantsExampleStarters.TTP_FHIR_BASE_URL).startWith(task());
2523
}
2624

0 commit comments

Comments
 (0)