File tree 4 files changed +10
-30
lines changed
4 files changed +10
-30
lines changed Original file line number Diff line number Diff line change 56
56
// TODO: Get summary DocumentReferences from resourcesToReview
57
57
let summaryDocRefs: any [] = resourcesToReview .filter ((r ) => r .resourceType === " DocumentReference" && ! (r .type ?.coding [0 ]?.code === " 34108-1" ));
58
58
// Compare sessionIDs in most recent DocRef with sessionID in most recent SHL
59
- let mostRecentDocRef = summaryDocRefs .sort ((a , b ) => b .date - a .date )[0 ];
59
+ // let mostRecentDocRef = summaryDocRefs.sort((a, b) => b.date - a.date)[0];
60
+ let mostRecentDocRef = summaryDocRefs [summaryDocRefs .length - 1 ];
60
61
// TODO: Get shl DocumentReferences from resourcesToReview
61
- let shlDocRefs: any [] = resourcesToReview .filter ((r ) => r .resourceType === " DocumentReference" && r .type ?.coding [0 ]?.code === " 34108-1" );
62
+ let shlDocRefs: any [] = resourcesToReview .filter ((r ) => r .resourceType === " DocumentReference" && r .type ?.coding [0 ]?.code === " 34108-1" ). reverse () ;
62
63
63
64
patientId = sofClient .getPatientID ();
64
65
sessionId = mostRecentDocRef .id ;
114
115
}
115
116
}
116
117
117
- console .log (" Successfully retrieved SHL and Resources" );
118
118
if (found ) {
119
+ console .log (" Successfully retrieved SHL and Resources" );
119
120
// The current SHL is most recent, so use it
120
121
shlReadyDispatch (' shl-ready' , true );
121
122
} else if (mostRecentDocRef ) {
Original file line number Diff line number Diff line change 1
1
<script lang =" ts" >
2
2
import QRCode from ' qrcode' ;
3
- import { getContext } from ' svelte' ;
3
+ import { getContext , setContext } from ' svelte' ;
4
4
import {
5
5
Button ,
6
6
Card ,
21
21
Row
22
22
} from ' sveltestrap' ;
23
23
import { fade } from ' svelte/transition' ;
24
- import { goto } from ' $app/navigation' ;
25
24
import type { Writable } from ' svelte/store' ;
26
25
import type { SHLAdminParams , SHLClient } from ' ./managementClient' ;
27
26
38
37
let exp: Date ;
39
38
let today: Date ;
40
39
let expDisplay: string ;
41
- let inactive = false ;
42
40
43
41
$ : {
44
42
href = getUrl ($shlStore );
86
84
shlClient .deleteShl ($shlStore );
87
85
toggle ();
88
86
// TODO: Implement post-deactivation flow
89
- goto ( ' /share ' );
87
+ location . reload ( true );
90
88
}
91
89
92
90
async function renewShl() {}
213
211
</div >
214
212
215
213
<style >
216
- img .qr {
217
- height : 100% ;
218
- }
219
- p .logo {
220
- position : relative ;
221
- width : 250px ;
222
- height : 250px ;
223
- }
224
- .logo {
225
- position : absolute ;
226
- background : #325c33 ;
227
- width : 110px ;
228
- height : 27px ;
229
- /* padding: 2px; */
230
- left : calc (50% - 55px );
231
- top : calc (50% - 2em );
232
- border : 5px solid #325c33 ;
233
- box-sizing : border-box ;
234
- }
235
214
:global(.shlbutton ) {
236
215
width : 300px !important ;
237
216
}
Original file line number Diff line number Diff line change @@ -81,7 +81,7 @@ export class SHLClient {
81
81
}
82
82
} ) ;
83
83
const res = await req . json ( ) ;
84
- return true ;
84
+ return res ;
85
85
}
86
86
87
87
async updateShl ( shl : SHLAdminParams ) : Promise < boolean > {
Original file line number Diff line number Diff line change @@ -105,15 +105,15 @@ export class SOFClient {
105
105
const shlData = {
106
106
id : shl . id ,
107
107
label : label ,
108
- patientId : shl . userId ,
108
+ userId : shl . userId ,
109
109
sessionId : docRef . id , //shl.sessionId,
110
110
managementToken : shl . managementToken ,
111
111
encryptionKey : shl . encryptionKey
112
112
} ;
113
113
const shlPayload = btoa ( JSON . stringify ( shlData ) ) ;
114
114
let shlDocRefInputs = {
115
115
date : new Date ( ) . toISOString ( ) ,
116
- patientId : shl . userId ,
116
+ userId : shl . userId ,
117
117
documentReferenceId : docRef . id ,
118
118
data : shlPayload ,
119
119
label : label ,
@@ -133,7 +133,7 @@ export class SOFClient {
133
133
]
134
134
} ,
135
135
"subject" : {
136
- "reference" : `Patient/ ${ shl . userId } `
136
+ "reference" : `Patient?identifier= ${ shl . userId } `
137
137
} ,
138
138
"date" : shlDocRefInputs . date ,
139
139
"description" : "SMART Health Link Metadata" ,
You can’t perform that action at this time.
0 commit comments