Skip to content

Commit fe1e17b

Browse files
committed
updating healthcare example
1 parent 3736400 commit fe1e17b

File tree

7 files changed

+72
-23
lines changed

7 files changed

+72
-23
lines changed

examples/healthcare/README.md

Lines changed: 44 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,9 @@ The sample data is located in the input/ folder.
1515
```
1616

1717
# TLDR; How do I run it?
18-
1. Download the latest quick-start jar from the [releases page](https://github.com/marklogic-community/marklogic-data-hub/releases) into this folder.
18+
1. Download the [latest quick-start war](https://github.com/marklogic-community/marklogic-data-hub/releases/download/v2.0.0-rc.2/quick-start-2.0.0-rc.2.war) into this folder.
1919

20-
1. Run the quick-start jar `java -jar quick-start.jar`
20+
1. Run the quick-start jar `java -jar quick-start-2.0.0-rc.2.war`
2121

2222
1. Open your web browser to [http://localhost:8080](http://localhost:8080).
2323

@@ -29,16 +29,51 @@ The sample data is located in the input/ folder.
2929

3030
1. Install the Hub into MarkLogic (if necessary)
3131

32-
1. Load hl7 data by pressing the **Load Data** button next to hl7. When prompted Set the Path to **input/hl7**. Set the collection to **hl7**. Set the Data Format to **Documents**. Now Press **Submit**.
32+
## Loading the HL7 data
3333

34-
1. Load nppes data by pressing the **Load Data** button next to nppes. When prompted Set the Path to **input/nppes**. Set the collection to **nppes**. Set the Data Format to **Delimited Text**. Now Press **Submit**.
34+
1. Click on the **Flows** tab.
3535

36-
1. At this point you have loaded the sample data. You can browse the data via [QConsole](http://localhost:8000/qconsole) or by searching the REST endpoint on the Staging Http Server [http://localhost:8010/v1/search](http://localhost:8010/v1/search). *Your port may be different if you changed it during setup*
36+
1. Click on Input Flows => hl7 on the left side.
3737

38-
1. To run the harmonize flows simply press the **Run** button next to the final flow.
38+
1. On the right side you can configure the MLCP (MarkLogic Content Pump) options.
3939

40-
1. Now you have harmonized the data into your final database. You can browse the data via [QConsole](http://localhost:8000/qconsole) or by searching the REST endpoint on the Final Http Server [http://localhost:8011/v1/search](http://localhost:8011/v1/search). *Your port may be different if you changed it during setup*
40+
1. Browse the Input Files to **input/hl7**.
4141

42+
1. Set the Data Format to **Documents**.
43+
44+
1. Now Click **RUN IMPORT**.
45+
46+
## Loading the NPPES data
47+
48+
1. Click on Input Flows => nppes on the left side.
49+
50+
1. On the right side you can configure the MLCP (MarkLogic Content Pump) options.
51+
52+
1. Browse the Input Files to **input/nppes**.
53+
54+
1. Set the Data Format to **Delimited Text**.
55+
56+
1. Now Click **RUN IMPORT**.
57+
58+
## Browsing the Staging Data
59+
60+
1. At this point you have loaded the sample data. You can browse the data by clicking on the Browse tab at the top menu.
61+
62+
## Harmonizing Data
63+
64+
1. Click on the **Flows** tab.
65+
66+
1. Click on the **final** flow.
67+
68+
1. To run the harmonize flows simply press the **Run** button on the info screen.
69+
70+
## Browsing the Harmonized Data
71+
72+
1. Now you have harmonized the data into your final database. You can browse the harmonized data by clicking on the Browse tab at the top menu.
73+
74+
1. Next change the database to **FINAL**.
75+
76+
1. Click Search.
4277

4378
# Entities
4479
Entities represent the data you are modeling. For this example we provide the **Patients** entity. Inside this entity definition you will find all of the example flows.
@@ -52,10 +87,10 @@ Flows are sets of plugins that work together to create an envelope document.
5287
## Input Flows
5388

5489
### hl7
55-
The hl7 Flow is intended to ingest C-CDA C32 Hl7 XML files. When running the hl7 flow simply point it at input/hl7. Set the collection to **hl7** and set the document type to **Document**.
90+
The hl7 Flow is intended to ingest C-CDA C32 Hl7 XML files. When running the hl7 flow simply point it at input/hl7. Set the document type to **Document**.
5691

5792
### nppes
58-
The nppes Flow is intended to ingest NPPES csv files. This flow will split each row of the NPPES file into a separate XML document in the staging database. When running the hl7 flow simply point it at input/nppes. Set the collection to **nppes** and set the document type to **Delimited Text**.
93+
The nppes Flow is intended to ingest NPPES csv files. This flow will split each row of the NPPES file into a separate XML document in the staging database. When running the hl7 flow simply point it at input/nppes. Set the document type to **Delimited Text**.
5994

6095
## Harmonize Flows
6196

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
{
2+
"info" : {
3+
"title" : "Patients",
4+
"version" : "0.0.1"
5+
},
6+
"definitions" : {
7+
"Patients" : {
8+
"required" : [ ],
9+
"rangeIndex" : [ ],
10+
"wordLexicon" : [ ],
11+
"properties" : { }
12+
}
13+
}
14+
}

examples/healthcare/plugins/entities/Patients/harmonize/REST/services/providers.xqy

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ xquery version "1.0-ml";
1717

1818
module namespace service = "http://marklogic.com/rest-api/resource/providers";
1919

20-
declare namespace envelope = "http://marklogic.com/data-hub/envelope";
20+
declare namespace es = "http://marklogic.com/entity-services";
2121

2222
declare option xdmp:mapping "false";
2323

@@ -32,6 +32,6 @@ declare function get(
3232
let $patient-id as xs:string := map:get($params, "patient-id")
3333
return
3434
document {
35-
/envelope:envelope/envelope:headers[patient-ssn = $patient-id]/providers
35+
/es:envelope/es:headers[patient-ssn = $patient-id]/providers
3636
}
3737
};

examples/healthcare/plugins/entities/Patients/harmonize/final/content/content.xqy

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ xquery version "1.0-ml";
22

33
module namespace plugin = "http://marklogic.com/data-hub/plugins";
44

5-
declare namespace envelope = "http://marklogic.com/data-hub/envelope";
5+
declare namespace es = "http://marklogic.com/entity-services";
66

77
declare option xdmp:mapping "false";
88

@@ -20,10 +20,10 @@ declare function plugin:create-content(
2020
{
2121
let $doc := fn:doc($id)
2222
return
23-
if ($doc/envelope:envelope) then
24-
$doc/envelope:envelope/envelope:content/node()
25-
else if ($doc/content) then
26-
$doc/content
23+
if ($doc/es:envelope) then
24+
$doc/es:envelope/es:instance/node()
25+
else if ($doc/envelope/instance) then
26+
$doc/envelope/instance
2727
else
2828
$doc
2929
};

examples/healthcare/plugins/entities/Patients/harmonize/final/headers/headers.xqy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ xquery version "1.0-ml";
22

33
module namespace plugin = "http://marklogic.com/data-hub/plugins";
44

5-
declare namespace envelope = "http://marklogic.com/data-hub/envelope";
5+
declare namespace es = "http://marklogic.com/entity-services";
66

77
declare namespace hl7 = "urn:hl7-org:v3";
88

@@ -19,7 +19,7 @@ declare option xdmp:mapping "false";
1919
:)
2020
declare function plugin:create-headers(
2121
$id as xs:string,
22-
$content as node()?,
22+
$content as item()?,
2323
$options as map:map) as node()*
2424
{
2525
(
@@ -48,7 +48,7 @@ declare function plugin:create-headers(
4848
<providers>
4949
{
5050
for $npi as xs:string in $content//hl7:id[@root="2.16.840.1.113883.4.6"]/@extension
51-
let $provider := fn:collection("nppes")/envelope:envelope/envelope:content/root[NPI = $npi]
51+
let $provider := fn:collection("nppes")/es:envelope/es:content/root[NPI = $npi]
5252
return
5353
<provider>
5454
<npi>{$npi}</npi>

examples/healthcare/plugins/entities/Patients/harmonize/final/triples/triples.xqy

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ xquery version "1.0-ml";
22

33
module namespace plugin = "http://marklogic.com/data-hub/plugins";
44

5-
declare namespace envelope = "http://marklogic.com/data-hub/envelope";
5+
declare namespace es = "http://marklogic.com/entity-services";
66

77
declare option xdmp:mapping "false";
88

@@ -18,8 +18,8 @@ declare option xdmp:mapping "false";
1818
:)
1919
declare function plugin:create-triples(
2020
$id as xs:string,
21-
$content as node()?,
22-
$headers as node()*,
21+
$content as item()?,
22+
$headers as item()*,
2323
$options as map:map) as sem:triple*
2424
{
2525
()

examples/healthcare/plugins/entities/Patients/harmonize/final/writer/writer.xqy

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,5 +18,5 @@ declare function plugin:write(
1818
$envelope as node(),
1919
$options as map:map) as empty-sequence()
2020
{
21-
xdmp:document-insert($id, $envelope)
21+
xdmp:document-insert($id, $envelope, xdmp:default-permissions(), map:get($options, "entity"))
2222
};

0 commit comments

Comments
 (0)