Skip to content

Commit 56fb69f

Browse files
committed
Merge branch 'ad-retrieval' of github.com:uwcirg/shl-ips into ad-retrieval
2 parents a4b58c1 + 2396863 commit 56fb69f

File tree

2 files changed

+20
-16
lines changed

2 files changed

+20
-16
lines changed

src/lib/FetchAD.svelte

+17-13
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,14 @@
1414
1515
const resourceDispatch = createEventDispatcher<{ 'update-resources': ResourceRetrieveEvent }>();
1616
17-
let defaultUrl = "https://fhir.ips-demo.dev.cirg.uw.edu/fhir";
17+
let selectedUrl = "https://qa-rr-fhir.maxmddirect.com";
1818
let processing = false;
1919
let fetchError = '';
2020
2121
let mrn = '';
22-
let first = '';
23-
let last = '';
24-
let dob = '';
22+
let first = 'Betsy';
23+
let last = 'Smith-Johnson';
24+
let dob = '1950-11-15';
2525
let address1 = '';
2626
let address2 = '';
2727
let city = '';
@@ -51,7 +51,7 @@
5151
5252
let summaryUrlValidated: URL | undefined = undefined;
5353
$: {
54-
setSummaryUrlValidated(defaultUrl);
54+
setSummaryUrlValidated(selectedUrl);
5555
}
5656
5757
function setSummaryUrlValidated(url: string) {
@@ -108,7 +108,7 @@
108108
}
109109
]
110110
};
111-
111+
112112
return patient;
113113
}
114114
@@ -124,13 +124,14 @@
124124
query += city ? `address-city=${city}&` : '';
125125
query += state ? `address-state=${state}&` : '';
126126
query += zip ? `address-postalcode=${zip}&` : '';
127-
return query.substring(0, query.length - 1);
127+
query += 'active=true';
128+
return query;
128129
}
129130
130131
async function fetchPatient(patient: any) {
131132
let result;
132133
try {
133-
result = await fetch(`${defaultUrl}/Patient/$match`, {
134+
result = await fetch(`${selectedUrl}/Patient/$match`, {
134135
method: 'POST',
135136
headers: { accept: 'application/json' },
136137
body: JSON.stringify(patient)
@@ -144,7 +145,7 @@
144145
});
145146
} catch (e) {
146147
let query = buildPatientSearchQuery();
147-
result = await fetch(`${defaultUrl}/Patient${query}`, {
148+
result = await fetch(`${selectedUrl}/Patient${query}`, {
148149
method: 'GET',
149150
headers: { accept: 'application/json' },
150151
}).then(function (response: any) {
@@ -172,7 +173,7 @@
172173
173174
async function fetchAdvanceDirective(patient: any) {
174175
let query = buildAdvanceDirectiveSearchQuery(patient);
175-
return result = await fetch(`${defaultUrl}/DocumentReference${query}`, {
176+
return result = await fetch(`${selectedUrl}/DocumentReference${query}`, {
176177
method: 'GET',
177178
headers: { accept: 'application/json' }
178179
}).then(function (response: any) {
@@ -194,7 +195,7 @@
194195
const patient = await fetchPatient(constructPatient());
195196
const contentResponse = await fetchAdvanceDirective(patient.id);
196197
content = await contentResponse.json();
197-
hostname = defaultUrl;
198+
hostname = selectedUrl;
198199
processing = false;
199200
let resources = content.entry ? content.entry.map((e) => {
200201
return e.resource;
@@ -222,11 +223,14 @@
222223
<FormGroup>
223224
<Row>
224225
<Row class="mx-2">
225-
<Input type="radio" bind:group={defaultUrl} value="https://fhir.ips-demo.dev.cirg.uw.edu/fhir" label="WA Verify+ Demo Server" />
226+
<Input type="radio" bind:group={selectedUrl} value="https://qa-rr-fhir.maxmddirect.com" label="AD Vault" />
227+
</Row>
228+
<Row class="mx-2">
229+
<Input type="radio" bind:group={selectedUrl} value="https://fhir.ips-demo.dev.cirg.uw.edu/fhir" label="WA Verify+ Demo Server" />
226230
</Row>
227231
</Row>
228232
</FormGroup>
229-
{#if defaultUrl}
233+
{#if selectedUrl}
230234
<FormGroup>
231235
<Label>Enter your information to fetch an advance directive</Label>
232236
<p class="text-secondary"><em>WA Verify+ does not save this information</em></p>

static/ips/index.html

+3-3
Original file line numberDiff line numberDiff line change
@@ -23,11 +23,11 @@
2323
<script src="https://unpkg.com/[email protected]/dist/squirrelly.min.js"></script>
2424
<script src="https://mozilla.github.io/pdf.js/build/pdf.mjs" type="module"></script>
2525
<!-- IPS Specific Custom CSS-->
26-
<link rel="stylesheet" href="./assets/css/custom.css">
26+
<link rel="stylesheet" href="/ips/assets/css/custom.css">
2727

2828
<!-- IPS Rendering -->
29-
<script type="module" src="./assets/js/renderIPS.js"></script>
30-
<script type="module" src="./assets/js/retreiveIPS.js"></script>
29+
<script type="module" src="/ips/assets/js/renderIPS.js"></script>
30+
<script type="module" src="/ips/assets/js/retreiveIPS.js"></script>
3131

3232

3333
<title>IPS Viewer</title>

0 commit comments

Comments
 (0)