@nsshunt/stsappframework 3.1.149 → 3.1.151
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/commonTypes.js +9 -1
- package/dist/commonTypes.js.map +1 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +1 -1
- package/dist/masterprocessbase.js +6 -6
- package/dist/masterprocessbase.js.map +1 -1
- package/dist/processbase.js +8 -6
- package/dist/processbase.js.map +1 -1
- package/dist/redisMessageHandler.js.map +1 -1
- package/dist/server.js.map +1 -1
- package/dist/serverprocessbase.js +6 -6
- package/dist/serverprocessbase.js.map +1 -1
- package/dist/singleprocessbase.js.map +1 -1
- package/dist/workerprocessbase.js.map +1 -1
- package/package.json +10 -10
- package/src/commonTypes.ts +170 -2
- package/src/index.ts +0 -3
- package/src/masterprocessbase.ts +1 -2
- package/src/processbase.ts +12 -9
- package/src/redisMessageHandler.ts +1 -3
- package/src/server.ts +1 -3
- package/src/serverprocessbase.ts +1 -1
- package/src/singleprocessbase.ts +1 -2
- package/src/tcpserver/appmaster.ts +1 -1
- package/src/workerprocessbase.ts +1 -2
- package/types/commonTypes.d.ts +129 -2
- package/types/commonTypes.d.ts.map +1 -1
- package/types/index.d.ts +0 -3
- package/types/index.d.ts.map +1 -1
- package/types/masterprocessbase.d.ts +1 -2
- package/types/masterprocessbase.d.ts.map +1 -1
- package/types/processbase.d.ts +3 -4
- package/types/processbase.d.ts.map +1 -1
- package/types/redisMessageHandler.d.ts +1 -2
- package/types/redisMessageHandler.d.ts.map +1 -1
- package/types/server.d.ts +1 -2
- package/types/server.d.ts.map +1 -1
- package/types/serverprocessbase.d.ts +1 -1
- package/types/serverprocessbase.d.ts.map +1 -1
- package/types/singleprocessbase.d.ts +1 -2
- package/types/singleprocessbase.d.ts.map +1 -1
- package/types/tcpserver/appmaster.d.ts +1 -1
- package/types/tcpserver/appmaster.d.ts.map +1 -1
- package/types/workerprocessbase.d.ts +1 -2
- package/types/workerprocessbase.d.ts.map +1 -1
- package/dist/fhir/STSFhirTypes.js +0 -11
- package/dist/fhir/STSFhirTypes.js.map +0 -1
- package/dist/fhir/dalFhirManager.js +0 -34
- package/dist/fhir/dalFhirManager.js.map +0 -1
- package/dist/fhir/dalFhirManagerBase.js +0 -63
- package/dist/fhir/dalFhirManagerBase.js.map +0 -1
- package/dist/fhir/dalFhirManagerIORedisJson.js +0 -250
- package/dist/fhir/dalFhirManagerIORedisJson.js.map +0 -1
- package/dist/fhir/dalFhirManagerIORedisJson.test.js +0 -73
- package/dist/fhir/dalFhirManagerIORedisJson.test.js.map +0 -1
- package/dist/fhir/dalFhirManagerPGRes.js +0 -133
- package/dist/fhir/dalFhirManagerPGRes.js.map +0 -1
- package/dist/fhir/dalFhirManagerPGRes.test.js +0 -72
- package/dist/fhir/dalFhirManagerPGRes.test.js.map +0 -1
- package/dist/fhir/dalFhirManagerPGResEntity.js +0 -166
- package/dist/fhir/dalFhirManagerPGResEntity.js.map +0 -1
- package/dist/fhir/dalFhirManagerPGResEntity.test.js +0 -73
- package/dist/fhir/dalFhirManagerPGResEntity.test.js.map +0 -1
- package/dist/fhir/dalFhirManagerRedisJson.js +0 -226
- package/dist/fhir/dalFhirManagerRedisJson.js.map +0 -1
- package/dist/fhir/dalFhirManagerRedisJson.test.js +0 -73
- package/dist/fhir/dalFhirManagerRedisJson.test.js.map +0 -1
- package/dist/fhir/dalFhirTestHelpers.js +0 -227
- package/dist/fhir/dalFhirTestHelpers.js.map +0 -1
- package/dist/processoptions.js +0 -12
- package/dist/processoptions.js.map +0 -1
- package/src/fhir/STSFhirTypes.ts +0 -541
- package/src/fhir/dalFhirManager.ts +0 -33
- package/src/fhir/dalFhirManagerBase.ts +0 -77
- package/src/fhir/dalFhirManagerIORedisJson.test.ts +0 -94
- package/src/fhir/dalFhirManagerIORedisJson.ts +0 -260
- package/src/fhir/dalFhirManagerPGRes.test.ts +0 -91
- package/src/fhir/dalFhirManagerPGRes.ts +0 -147
- package/src/fhir/dalFhirManagerPGResEntity.test.ts +0 -93
- package/src/fhir/dalFhirManagerPGResEntity.ts +0 -183
- package/src/fhir/dalFhirManagerRedisJson.test.ts +0 -93
- package/src/fhir/dalFhirManagerRedisJson.ts +0 -230
- package/src/fhir/dalFhirTestHelpers.ts +0 -276
- package/src/processoptions.ts +0 -169
- package/types/fhir/STSFhirTypes.d.ts +0 -351
- package/types/fhir/STSFhirTypes.d.ts.map +0 -1
- package/types/fhir/dalFhirManager.d.ts +0 -7
- package/types/fhir/dalFhirManager.d.ts.map +0 -1
- package/types/fhir/dalFhirManagerBase.d.ts +0 -19
- package/types/fhir/dalFhirManagerBase.d.ts.map +0 -1
- package/types/fhir/dalFhirManagerIORedisJson.d.ts +0 -18
- package/types/fhir/dalFhirManagerIORedisJson.d.ts.map +0 -1
- package/types/fhir/dalFhirManagerIORedisJson.test.d.ts +0 -2
- package/types/fhir/dalFhirManagerIORedisJson.test.d.ts.map +0 -1
- package/types/fhir/dalFhirManagerPGRes.d.ts +0 -14
- package/types/fhir/dalFhirManagerPGRes.d.ts.map +0 -1
- package/types/fhir/dalFhirManagerPGRes.test.d.ts +0 -2
- package/types/fhir/dalFhirManagerPGRes.test.d.ts.map +0 -1
- package/types/fhir/dalFhirManagerPGResEntity.d.ts +0 -14
- package/types/fhir/dalFhirManagerPGResEntity.d.ts.map +0 -1
- package/types/fhir/dalFhirManagerPGResEntity.test.d.ts +0 -2
- package/types/fhir/dalFhirManagerPGResEntity.test.d.ts.map +0 -1
- package/types/fhir/dalFhirManagerRedisJson.d.ts +0 -15
- package/types/fhir/dalFhirManagerRedisJson.d.ts.map +0 -1
- package/types/fhir/dalFhirManagerRedisJson.test.d.ts +0 -2
- package/types/fhir/dalFhirManagerRedisJson.test.d.ts.map +0 -1
- package/types/fhir/dalFhirTestHelpers.d.ts +0 -20
- package/types/fhir/dalFhirTestHelpers.d.ts.map +0 -1
- package/types/processoptions.d.ts +0 -128
- package/types/processoptions.d.ts.map +0 -1
package/src/fhir/STSFhirTypes.ts
DELETED
|
@@ -1,541 +0,0 @@
|
|
|
1
|
-
import { IDBAccessLayer } from '@nsshunt/stsdatamanagement'
|
|
2
|
-
import { JSONObject } from '@nsshunt/stsutils'
|
|
3
|
-
|
|
4
|
-
export interface IBase {
|
|
5
|
-
|
|
6
|
-
}
|
|
7
|
-
|
|
8
|
-
export interface IExtension {
|
|
9
|
-
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
export interface IElement extends IBase {
|
|
13
|
-
id?: string
|
|
14
|
-
extension?: IExtension
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
export interface IDataType extends IElement {
|
|
18
|
-
|
|
19
|
-
}
|
|
20
|
-
|
|
21
|
-
export interface IPrimitiveType extends IDataType {
|
|
22
|
-
|
|
23
|
-
}
|
|
24
|
-
|
|
25
|
-
export interface ICode extends IPrimitiveType {
|
|
26
|
-
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
export interface IResource extends IBase {
|
|
30
|
-
id?: IId
|
|
31
|
-
meta?: IMeta
|
|
32
|
-
implicitRules?: string // uri
|
|
33
|
-
language?: string // code
|
|
34
|
-
}
|
|
35
|
-
|
|
36
|
-
export type IId = string;
|
|
37
|
-
|
|
38
|
-
export type IUri = string;
|
|
39
|
-
|
|
40
|
-
export type IUrl = string;
|
|
41
|
-
|
|
42
|
-
export interface ICanonical<T> extends IPrimitiveType {
|
|
43
|
-
uri: IUri
|
|
44
|
-
_type: T
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
export type IMarkdown = string;
|
|
48
|
-
|
|
49
|
-
export type IMimeType = string;
|
|
50
|
-
|
|
51
|
-
export interface IMeta extends IDataType {
|
|
52
|
-
// from Element: extension
|
|
53
|
-
versionId? : IId, // Version specific identifier
|
|
54
|
-
lastUpdated? : IInstant, // When the resource version last changed
|
|
55
|
-
source? : IUri, // Identifies where the resource comes from
|
|
56
|
-
profile? : ICanonical<IStructureDefinition>[], // Profiles this resource claims to conform to
|
|
57
|
-
security? : ICoding[], // Security Labels applied to this resource
|
|
58
|
-
tag? : ICoding[] // Tags applied to this resource
|
|
59
|
-
}
|
|
60
|
-
|
|
61
|
-
// https://www.hl7.org/fhir/narrative.html#Narrative
|
|
62
|
-
export interface INarrative extends IDataType {
|
|
63
|
-
status: 'generated' | 'extensions' | 'additional' | 'empty'
|
|
64
|
-
div: string // xhtml
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
// https://www.hl7.org/fhir/domainresource.html
|
|
68
|
-
export interface IDomainResource extends IResource {
|
|
69
|
-
text?: INarrative
|
|
70
|
-
contained?: IResource
|
|
71
|
-
extension?: IExtension
|
|
72
|
-
modifierExtension?: IExtension
|
|
73
|
-
_resourceType: string
|
|
74
|
-
}
|
|
75
|
-
|
|
76
|
-
// https://hl7.org/fhir/R5/structuredefinition.html#StructureDefinition
|
|
77
|
-
export interface IStructureDefinition extends IDomainResource {
|
|
78
|
-
_resourceType : "StructureDefinition",
|
|
79
|
-
// from Resource: id, meta, implicitRules, and language
|
|
80
|
-
// from DomainResource: text, contained, extension, and modifierExtension
|
|
81
|
-
url : IUri, // I R! Canonical identifier for this structure definition, represented as a URI (globally unique)
|
|
82
|
-
identifier? : IIdentifier[], // Additional identifier for the structure definition
|
|
83
|
-
version? : string, // Business version of the structure definition
|
|
84
|
-
// versionAlgorithm[x]: How to compare versions. One of these 2:
|
|
85
|
-
versionAlgorithmString? : string,
|
|
86
|
-
versionAlgorithmCoding? : ICoding,
|
|
87
|
-
name : string, // I R! Name for this structure definition (computer friendly)
|
|
88
|
-
title? : string, // Name for this structure definition (human friendly)
|
|
89
|
-
status : 'draft' | 'active' | 'retired' | 'unknown'
|
|
90
|
-
experimental? : boolean, // For testing purposes, not real usage
|
|
91
|
-
date? : IDateTime, // Date last changed
|
|
92
|
-
publisher? : string, // Name of the publisher/steward (organization or individual)
|
|
93
|
-
contact? : IContactDetail[], // Contact details for the publisher
|
|
94
|
-
description? : IMarkdown // "<markdown>", // Natural language description of the structure definition
|
|
95
|
-
useContext? : IUsageContext[] // The context that the content is intended to support
|
|
96
|
-
jurisdiction? : ICodeableConcept[], // Intended jurisdiction for structure definition (if applicable)
|
|
97
|
-
purpose? : IMarkdown // "<markdown>", // Why this structure definition is defined
|
|
98
|
-
copyright? : IMarkdown // "<markdown>", // Use and/or publishing restrictions
|
|
99
|
-
copyrightLabel? : string, // Copyright holder and year(s)
|
|
100
|
-
keyword? : ICoding[], // Assist with indexing and finding
|
|
101
|
-
fhirVersion? : ICode // "<code>", // FHIR Version this StructureDefinition targets
|
|
102
|
-
mapping? : { // External specification that the content is mapped to
|
|
103
|
-
identity : IId, // R! Internal id when this mapping is used
|
|
104
|
-
uri? : IUri, // I Identifies what this mapping refers to
|
|
105
|
-
name? : string, // I Names what this mapping refers to
|
|
106
|
-
comment? : string // Versions, Issues, Scope limitations etc
|
|
107
|
-
}[],
|
|
108
|
-
kind : 'primitive-type' | 'complex-type' | 'resource' | 'logical'
|
|
109
|
-
abstract : boolean, // I R! Whether the structure is abstract
|
|
110
|
-
context?: { // I If an extension, where it can be used in instances
|
|
111
|
-
type : 'fhirpath' | 'element' | 'extension'
|
|
112
|
-
expression : string // R! Where the extension can be used in instances
|
|
113
|
-
}[],
|
|
114
|
-
contextInvariant? : string[], // I FHIRPath invariants - when the extension can be used
|
|
115
|
-
type : IUri, // I R! Type defined or constrained by this structure
|
|
116
|
-
baseDefinition? : ICanonical<IStructureDefinition>, // I Definition that this type is constrained/specialized from
|
|
117
|
-
derivation? : 'specialization' | 'constraint' // - How relates to base definition
|
|
118
|
-
snapshot? : { // I Snapshot view of the structure
|
|
119
|
-
element : IElementDefinition[] // I R! Definition of elements in the resource (if no StructureDefinition)
|
|
120
|
-
},
|
|
121
|
-
differential? : { // I Differential view of the structure
|
|
122
|
-
element : IElementDefinition[] // I R! Definition of elements in the resource (if no StructureDefinition)
|
|
123
|
-
}
|
|
124
|
-
}
|
|
125
|
-
|
|
126
|
-
// https://hl7.org/fhir/R5/datatypes.html#Coding
|
|
127
|
-
// https://hl7.org/fhir/R5/datatypes.html#code
|
|
128
|
-
export interface ICoding extends IDataType {
|
|
129
|
-
// from Element: extension
|
|
130
|
-
system? : IUri // "<uri>", // Identity of the terminology system
|
|
131
|
-
version? : string // Version of the system - if relevant
|
|
132
|
-
code? : string // "<code>", // I Symbol in syntax defined by the system
|
|
133
|
-
display? : string // I Representation defined by the system
|
|
134
|
-
userSelected? : boolean // If this coding was chosen directly by the user
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
// https://hl7.org/fhir/R5/datatypes.html#CodeableConcept
|
|
138
|
-
export interface ICodeableConcept {
|
|
139
|
-
// from Element: extension
|
|
140
|
-
coding? : ICoding[], // Code defined by a terminology system
|
|
141
|
-
text? : string // Plain text representation of the concept
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
// https://www.hl7.org/fhir/references.html#Reference
|
|
145
|
-
export interface IReference<T> extends IDataType {
|
|
146
|
-
// from Element: extension
|
|
147
|
-
reference? : string, // I Literal reference, Relative, internal or absolute URL
|
|
148
|
-
type? : IUri // "<uri>", // Type the reference refers to (e.g. "Patient") - must be a resource in resources
|
|
149
|
-
identifier? : IIdentifier // I Logical reference, when literal reference is not known
|
|
150
|
-
display? : string // I Text alternative for the resource
|
|
151
|
-
_type: T
|
|
152
|
-
}
|
|
153
|
-
|
|
154
|
-
// https://www.hl7.org/fhir/references.html#CodeableReference
|
|
155
|
-
export interface ICodeableReference<T> extends IDataType {
|
|
156
|
-
// from Element: extension
|
|
157
|
-
concept? : ICodeableConcept, // Reference to a concept (by class)
|
|
158
|
-
reference? : IReference<T> // Reference to a resource (by instance)
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
// https://hl7.org/fhir/R5/datatypes.html#identifier
|
|
162
|
-
export interface IIdentifier extends IDataType {
|
|
163
|
-
// from Element: extension
|
|
164
|
-
use? : "usual" | "official" | "temp" | "secondary" | "old"
|
|
165
|
-
type? : ICodeableConcept, // Description of identifier
|
|
166
|
-
system? : string // "<uri>", // The namespace for the identifier value
|
|
167
|
-
value? : string, // I The value that is unique
|
|
168
|
-
period? : IPeriod, // Time period when id is/was valid for use
|
|
169
|
-
assigner? : IReference<IOrganization> // Organization that issued id (may be just text)
|
|
170
|
-
}
|
|
171
|
-
|
|
172
|
-
// https://www.hl7.org/fhir/datatypes.html#Period
|
|
173
|
-
export interface IPeriod extends IDataType {
|
|
174
|
-
// from Element: extension
|
|
175
|
-
start? : Date // "<dateTime>", // I Starting time with inclusive boundary
|
|
176
|
-
end? : Date // "<dateTime>" // I End time with inclusive boundary, if not ongoing
|
|
177
|
-
}
|
|
178
|
-
|
|
179
|
-
// https://www.hl7.org/fhir/datatypes.html#instant
|
|
180
|
-
export interface IInstant extends IPrimitiveType {
|
|
181
|
-
dateTime: Date | number | string
|
|
182
|
-
}
|
|
183
|
-
|
|
184
|
-
// https://www.hl7.org/fhir/datatypes.html#dateTime
|
|
185
|
-
export interface IDateTime extends IPrimitiveType {
|
|
186
|
-
dateTime: Date | number | string
|
|
187
|
-
}
|
|
188
|
-
|
|
189
|
-
// https://www.hl7.org/fhir/datatypes.html#Money
|
|
190
|
-
export interface IMoney extends IDataType {
|
|
191
|
-
// from Element: extension
|
|
192
|
-
value? : number // <decimal>, // Numerical value (with implicit precision)
|
|
193
|
-
currency? : string // "<code>" // ISO 4217 Currency Code
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
export interface IContactDetail {
|
|
197
|
-
|
|
198
|
-
}
|
|
199
|
-
|
|
200
|
-
export interface IElementDefinition {
|
|
201
|
-
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
export interface IUsageContext {
|
|
205
|
-
|
|
206
|
-
}
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
/*
|
|
211
|
-
declare interface IElement<T> {
|
|
212
|
-
id: string
|
|
213
|
-
extension: IExtension[]
|
|
214
|
-
}
|
|
215
|
-
*/
|
|
216
|
-
|
|
217
|
-
/*
|
|
218
|
-
// https://hl7.org/fhir/R5/extensibility.html#extension
|
|
219
|
-
declare interface IExtension {
|
|
220
|
-
// from Element: extension
|
|
221
|
-
"url" : string // "<uri>", // R! identifies the meaning of the extension
|
|
222
|
-
// value[x]: Value of extension. One of these 54:
|
|
223
|
-
"valueBase64Binary" : "<base64Binary>"
|
|
224
|
-
"valueBoolean" : boolean,
|
|
225
|
-
"valueCanonical" : "<canonical>",
|
|
226
|
-
"valueCode" : "<code>",
|
|
227
|
-
"valueDate" : "<date>",
|
|
228
|
-
"valueDateTime" : "<dateTime>",
|
|
229
|
-
"valueDecimal" : <decimal>,
|
|
230
|
-
"valueId" : "<id>",
|
|
231
|
-
"valueInstant" : "<instant>",
|
|
232
|
-
"valueInteger" : <integer>,
|
|
233
|
-
"valueInteger64" : "<integer64>",
|
|
234
|
-
"valueMarkdown" : "<markdown>",
|
|
235
|
-
"valueOid" : "<oid>",
|
|
236
|
-
"valuePositiveInt" : "<positiveInt>",
|
|
237
|
-
"valueString" : "<string>",
|
|
238
|
-
"valueTime" : "<time>",
|
|
239
|
-
"valueUnsignedInt" : "<unsignedInt>",
|
|
240
|
-
"valueUri" : "<uri>",
|
|
241
|
-
"valueUrl" : "<url>",
|
|
242
|
-
"valueUuid" : "<uuid>",
|
|
243
|
-
"valueAddress" : { Address },
|
|
244
|
-
"valueAge" : { Age },
|
|
245
|
-
"valueAnnotation" : { Annotation },
|
|
246
|
-
"valueAttachment" : { Attachment },
|
|
247
|
-
"valueCodeableConcept" : { CodeableConcept },
|
|
248
|
-
"valueCodeableReference" : { CodeableReference },
|
|
249
|
-
"valueCoding" : { Coding },
|
|
250
|
-
"valueContactPoint" : { ContactPoint },
|
|
251
|
-
"valueCount" : { Count },
|
|
252
|
-
"valueDistance" : { Distance },
|
|
253
|
-
"valueDuration" : { Duration },
|
|
254
|
-
"valueHumanName" : { HumanName },
|
|
255
|
-
"valueIdentifier" : { Identifier },
|
|
256
|
-
"valueMoney" : { Money },
|
|
257
|
-
"valuePeriod" : { Period },
|
|
258
|
-
"valueQuantity" : { Quantity },
|
|
259
|
-
"valueRange" : { Range },
|
|
260
|
-
"valueRatio" : { Ratio },
|
|
261
|
-
"valueRatioRange" : { RatioRange },
|
|
262
|
-
"valueReference" : { Reference },
|
|
263
|
-
"valueSampledData" : { SampledData },
|
|
264
|
-
"valueSignature" : { Signature },
|
|
265
|
-
"valueTiming" : { Timing },
|
|
266
|
-
"valueContactDetail" : { ContactDetail },
|
|
267
|
-
"valueDataRequirement" : { DataRequirement },
|
|
268
|
-
"valueExpression" : { Expression },
|
|
269
|
-
"valueParameterDefinition" : { ParameterDefinition },
|
|
270
|
-
"valueRelatedArtifact" : { RelatedArtifact },
|
|
271
|
-
"valueTriggerDefinition" : { TriggerDefinition },
|
|
272
|
-
"valueUsageContext" : { UsageContext },
|
|
273
|
-
"valueAvailability" : { Availability },
|
|
274
|
-
"valueExtendedContactDetail" : { ExtendedContactDetail },
|
|
275
|
-
"valueDosage" : { Dosage },
|
|
276
|
-
"valueMeta" : { Meta },
|
|
277
|
-
}
|
|
278
|
-
*/
|
|
279
|
-
|
|
280
|
-
// https://www.hl7.org/fhir/account.html
|
|
281
|
-
export interface IAccount extends IDomainResource {
|
|
282
|
-
_resourceType : "Account",
|
|
283
|
-
// from Resource: id, meta, implicitRules, and language
|
|
284
|
-
// from DomainResource: text, contained, extension, and modifierExtension
|
|
285
|
-
identifier? : IIdentifier[], // Account number
|
|
286
|
-
status : "active" | "inactive" | "entered-in-error" | "on-hold" | "unknown"
|
|
287
|
-
billingStatus? : ICodeableConcept, // Tracks the lifecycle of the account through the billing process
|
|
288
|
-
type? : ICodeableConcept, // E.g. patient, expense, depreciation
|
|
289
|
-
name? : string, // Human-readable label
|
|
290
|
-
subject? : IReference<IDevice | IHealthcareService | ILocation | IOrganization | IPatient | IPractitioner | IPractitionerRole>[], // The entity that caused the expenses
|
|
291
|
-
servicePeriod? : IPeriod, // Transaction window
|
|
292
|
-
coverage? : [{ // The party(s) that are responsible for covering the payment of this account, and what order should they be applied to the account
|
|
293
|
-
coverage : IReference<ICoverage>, // R! The party(s), such as insurances, that may contribute to the payment of this account
|
|
294
|
-
priority? : number // "<positiveInt>" // The priority of the coverage in the context of this account
|
|
295
|
-
}],
|
|
296
|
-
owner? : IReference<IOrganization>, // Entity managing the Account
|
|
297
|
-
description? : string; // "<markdown>", // Explanation of purpose/use
|
|
298
|
-
guarantor? : { // The parties ultimately responsible for balancing the Account
|
|
299
|
-
party : IReference<IOrganization | IPatient | IRelatedPerson>, // R! Responsible entity
|
|
300
|
-
onHold? : true, // Credit or other hold applied
|
|
301
|
-
period? : IPeriod // Guarantee account during
|
|
302
|
-
}[],
|
|
303
|
-
diagnosis? : { // The list of diagnoses relevant to this account
|
|
304
|
-
sequence? : number // "<positiveInt>", // Ranking of the diagnosis (for each type)
|
|
305
|
-
condition : ICodeableReference<ICondition>, // I R! The diagnosis relevant to the account
|
|
306
|
-
dateOfDiagnosis? : IDateTime // "<dateTime>", // I Date of the diagnosis (when coded diagnosis)
|
|
307
|
-
type? : ICodeableConcept[], // Type that this diagnosis has relevant to the account (e.g. admission, billing, discharge …)
|
|
308
|
-
onAdmission? : boolean, // Diagnosis present on Admission
|
|
309
|
-
packageCode? : ICodeableConcept[] // Package Code specific for billing
|
|
310
|
-
}[],
|
|
311
|
-
procedure? : { // The list of procedures relevant to this account
|
|
312
|
-
sequence? : number // "<positiveInt>", // Ranking of the procedure (for each type)
|
|
313
|
-
code : ICodeableReference<IProcedure>, // I R! The procedure relevant to the account
|
|
314
|
-
dateOfService? : IDateTime, // I Date of the procedure (when coded procedure)
|
|
315
|
-
type? : ICodeableConcept[], // How this procedure value should be used in charging the account
|
|
316
|
-
packageCode? : ICodeableConcept[], // Package Code specific for billing
|
|
317
|
-
device? : IReference<IDevice>[] // Any devices that were associated with the procedure
|
|
318
|
-
}[],
|
|
319
|
-
relatedAccount? : { // Other associated accounts related to this account
|
|
320
|
-
relationship? : ICodeableConcept, // Relationship of the associated Account
|
|
321
|
-
account : IReference<IAccount> // R! Reference to an associated Account
|
|
322
|
-
}[],
|
|
323
|
-
currency? : ICodeableConcept, // The base or default currency
|
|
324
|
-
balance?: { // Calculated account balance(s)
|
|
325
|
-
aggregate? : ICodeableConcept, // Who is expected to pay this part of the balance
|
|
326
|
-
term? : ICodeableConcept, // current | 30 | 60 | 90 | 120
|
|
327
|
-
estimate? : boolean, // Estimated balance
|
|
328
|
-
amount : IMoney // R! Calculated amount
|
|
329
|
-
}[],
|
|
330
|
-
calculatedAt? : IInstant // Time the balance amount was calculated
|
|
331
|
-
}
|
|
332
|
-
|
|
333
|
-
// https://www.hl7.org/fhir/organization.html#Organization
|
|
334
|
-
export interface IOrganization extends IDomainResource {
|
|
335
|
-
_resourceType : "Organization",
|
|
336
|
-
// from Resource: id, meta, implicitRules, and language
|
|
337
|
-
// from DomainResource: text, contained, extension, and modifierExtension
|
|
338
|
-
identifier? : IIdentifier[], // I Identifies this organization across multiple systems
|
|
339
|
-
active? : boolean, // Whether the organization's record is still in active use
|
|
340
|
-
type? : ICodeableConcept[], // Kind of organization
|
|
341
|
-
name? : string, // I Name used for the organization
|
|
342
|
-
alias? : string[], // A list of alternate names that the organization is known as, or was known as in the past
|
|
343
|
-
description? : IMarkdown // "<markdown>", // Additional details about the Organization that could be displayed as further information to identify the Organization beyond its name
|
|
344
|
-
contact? : IExtendedContactDetail[], // Official contact details for the Organization
|
|
345
|
-
partOf? : IReference<IOrganization>, // The organization of which this organization forms a part
|
|
346
|
-
endpoint? : IReference<IEndpoint>[], // Technical endpoints providing access to services operated for the organization
|
|
347
|
-
qualification? : { // Qualifications, certifications, accreditations, licenses, training, etc. pertaining to the provision of care
|
|
348
|
-
identifier? : IIdentifier[], // An identifier for this qualification for the organization
|
|
349
|
-
code : ICodeableConcept, // R! Coded representation of the qualification
|
|
350
|
-
period? : IPeriod, // Period during which the qualification is valid
|
|
351
|
-
issuer? : IReference<IOrganization> // Organization that regulates and issues the qualification
|
|
352
|
-
}[]
|
|
353
|
-
}
|
|
354
|
-
|
|
355
|
-
// https://www.hl7.org/fhir/endpoint.html#Endpoint
|
|
356
|
-
export interface IEndpoint extends IDomainResource{
|
|
357
|
-
resourceType : "Endpoint",
|
|
358
|
-
// from Resource: id, meta, implicitRules, and language
|
|
359
|
-
// from DomainResource: text, contained, extension, and modifierExtension
|
|
360
|
-
identifier? : IIdentifier[], // Identifies this endpoint across multiple systems
|
|
361
|
-
status : 'active' | 'suspended' | 'error' | 'off' | 'entered-in-error' | 'test'
|
|
362
|
-
connectionType : ICodeableConcept[], // R! Protocol/Profile/Standard to be used with this endpoint connection
|
|
363
|
-
name? : string, // A name that this endpoint can be identified by
|
|
364
|
-
description? : string, // Additional details about the endpoint that could be displayed as further information to identify the description beyond its name
|
|
365
|
-
environmentType? : ICodeableConcept[], // The type of environment(s) exposed at this endpoint
|
|
366
|
-
managingOrganization? : IReference<IOrganization>, // Organization that manages this endpoint (might not be the organization that exposes the endpoint)
|
|
367
|
-
contact? : IContactPoint[], // Contact details for source (e.g. troubleshooting)
|
|
368
|
-
period? : IPeriod, // Interval the endpoint is expected to be operational
|
|
369
|
-
payload? : { // Set of payloads that are provided by this endpoint
|
|
370
|
-
type? : ICodeableConcept[], // The type of content that may be used at this endpoint (e.g. XDS Discharge summaries)
|
|
371
|
-
mimeType? : IMimeType[] // Mimetype to send. If not specified, the content could be anything (including no payload, if the connectionType defined this)
|
|
372
|
-
}[],
|
|
373
|
-
address : IUrl, // R! The technical base address for connecting to this endpoint
|
|
374
|
-
header? : string[] // Usage depends on the channel type
|
|
375
|
-
}
|
|
376
|
-
|
|
377
|
-
// https://www.hl7.org/fhir/metadatatypes.html#ExtendedContactDetail
|
|
378
|
-
export interface IExtendedContactDetail extends IDataType {
|
|
379
|
-
// from Element: extension
|
|
380
|
-
purpose? : ICodeableConcept, // The type of contact icon
|
|
381
|
-
name? : IHumanName[], // Name of an individual to contact
|
|
382
|
-
telecom? : IContactPoint[], // Contact details (e.g.phone/fax/url)
|
|
383
|
-
address? : IAddress, // Address for the contact
|
|
384
|
-
organization? : IReference<IOrganization>, // This contact detail is handled/monitored by a specific organization
|
|
385
|
-
period? : IPeriod // Period that this contact was valid for usage
|
|
386
|
-
}
|
|
387
|
-
|
|
388
|
-
// https://www.hl7.org/fhir/datatypes.html#humanname
|
|
389
|
-
export interface IHumanName extends IDataType {
|
|
390
|
-
// from Element: extension
|
|
391
|
-
use? : 'usual' | 'official' | 'temp' | 'nickname' | 'anonymous' | 'old' | 'maiden'
|
|
392
|
-
text? : string, // Text representation of the full name
|
|
393
|
-
family? : string, // Family name (often called 'Surname')
|
|
394
|
-
given? : string[], // Given names (not always 'first'). Includes middle names
|
|
395
|
-
prefix? : string[], // Parts that come before the name
|
|
396
|
-
suffix? : string[], // Parts that come after the name
|
|
397
|
-
period? : IPeriod // Time period when name was/is in use
|
|
398
|
-
}
|
|
399
|
-
|
|
400
|
-
// https://www.hl7.org/fhir/datatypes.html#ContactPoint
|
|
401
|
-
export interface IContactPoint extends IDataType {
|
|
402
|
-
// from Element: extension
|
|
403
|
-
system? : 'phone' | 'fax' | 'email' | 'pager' | 'url' | 'sms' | 'other'
|
|
404
|
-
value? : string, // I The actual contact point details
|
|
405
|
-
use? : 'home' | 'work' | 'temp' | 'old' | 'mobile' // purpose of this contact point'
|
|
406
|
-
rank? : number // "<positiveInt>", // Specify preferred order of use (1 = highest)
|
|
407
|
-
period? : IPeriod // Time period when the contact point was/is in use
|
|
408
|
-
}
|
|
409
|
-
|
|
410
|
-
export interface IAddress {
|
|
411
|
-
|
|
412
|
-
}
|
|
413
|
-
|
|
414
|
-
export interface ICoverage {
|
|
415
|
-
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
export interface IPatient {
|
|
419
|
-
|
|
420
|
-
}
|
|
421
|
-
|
|
422
|
-
export interface IDevice {
|
|
423
|
-
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
export interface IHealthcareService {
|
|
427
|
-
|
|
428
|
-
}
|
|
429
|
-
|
|
430
|
-
export interface ILocation {
|
|
431
|
-
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
export interface IPractitioner {
|
|
435
|
-
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
export interface IPractitionerRole {
|
|
439
|
-
|
|
440
|
-
}
|
|
441
|
-
|
|
442
|
-
export interface IRelatedPerson {
|
|
443
|
-
|
|
444
|
-
}
|
|
445
|
-
|
|
446
|
-
export interface ICondition {
|
|
447
|
-
|
|
448
|
-
}
|
|
449
|
-
|
|
450
|
-
export interface IProcedure {
|
|
451
|
-
|
|
452
|
-
}
|
|
453
|
-
|
|
454
|
-
export interface IAttachment {
|
|
455
|
-
|
|
456
|
-
}
|
|
457
|
-
|
|
458
|
-
export interface IPerson extends IDomainResource {
|
|
459
|
-
_resourceType : "Person",
|
|
460
|
-
// from Resource: id, meta, implicitRules, and language
|
|
461
|
-
// from DomainResource: text, contained, extension, and modifierExtension
|
|
462
|
-
identifier? : IIdentifier[], // A human identifier for this person
|
|
463
|
-
active? : boolean, // This person's record is in active use
|
|
464
|
-
name? : IHumanName[], // A name associated with the person
|
|
465
|
-
telecom? : IContactPoint[], // A contact detail for the person
|
|
466
|
-
gender? : 'male' | 'female' | 'other' | 'unknown'
|
|
467
|
-
birthDate? : Date, // The date on which the person was born
|
|
468
|
-
// deceased[x]: Indicates if the individual is deceased or not. One of these 2:
|
|
469
|
-
deceasedBoolean? : boolean,
|
|
470
|
-
deceasedDateTime? : IDateTime,
|
|
471
|
-
address? : IAddress[], // One or more addresses for the person
|
|
472
|
-
maritalStatus? : ICodeableConcept, // Marital (civil) status of a person
|
|
473
|
-
photo? : IAttachment[], // Image of the person
|
|
474
|
-
communication? : { // A language which may be used to communicate with the person about his or her health
|
|
475
|
-
language : ICodeableConcept, // R! The language which can be used to communicate with the person about his or her health
|
|
476
|
-
preferred? : boolean // Language preference indicator
|
|
477
|
-
}[],
|
|
478
|
-
managingOrganization? : IReference<IOrganization>[], // The organization that is the custodian of the person record
|
|
479
|
-
link? : { // Link to a resource that concerns the same actual person
|
|
480
|
-
target : IReference<IPatient|IPerson|IPractitioner|IRelatedPerson>, // R! The resource to which this actual person is associated
|
|
481
|
-
assurance? : 'level1' | 'level2' | 'level3' | 'level4'
|
|
482
|
-
}[]
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
// -------------------------------------------------------------------------------------------------
|
|
486
|
-
|
|
487
|
-
export interface IFHIRResource {
|
|
488
|
-
name: string
|
|
489
|
-
description: string
|
|
490
|
-
notes: string
|
|
491
|
-
}
|
|
492
|
-
|
|
493
|
-
export interface IPersonResource {
|
|
494
|
-
name: string
|
|
495
|
-
description: string
|
|
496
|
-
notes: string
|
|
497
|
-
}
|
|
498
|
-
|
|
499
|
-
export interface IDALFhirDataAccessManager<T> {
|
|
500
|
-
GetFhirResource(fhir: Partial<T>, ecb?: (fhir: Partial<T>, error: Error) => void): Promise<T | null>
|
|
501
|
-
GetFhirResources(filters: string[], ecb?: (filters: string[], error: Error) => void): Promise<T[] | null>
|
|
502
|
-
CreateFhirResource(fhir: T, ecb?: (fhir: T, error: Error) => void): Promise<T | null>
|
|
503
|
-
CreateFhirResources(fhir: T[], ecb?: (fhir: T, error: Error) => void): Promise<(T | null)[]>
|
|
504
|
-
UpdateFhirResource(fhir: T, ecb?: (fhir: T, error: Error) => void): Promise<T | null>
|
|
505
|
-
UpdateFhirResources(fhir: T[], ecb?: (fhir: T, error: Error) => void): Promise<(T | null)[]>
|
|
506
|
-
DeleteFhirResource(fhir: Partial<T>, ecb?: (fhir: Partial<T>, error: Error) => void): Promise<T | null>
|
|
507
|
-
DeleteFhirResources(fhir: Partial<T>[], ecb?: (fhir: Partial<T>, error: Error) => void): Promise<(T | null)[]>
|
|
508
|
-
Start(): Promise<void>
|
|
509
|
-
Stop(): Promise<void>
|
|
510
|
-
get options()
|
|
511
|
-
set options(options: JSONObject)
|
|
512
|
-
}
|
|
513
|
-
|
|
514
|
-
export interface IFhirManagerBaseOptions {
|
|
515
|
-
resourceName: string
|
|
516
|
-
dbactionuser: string
|
|
517
|
-
}
|
|
518
|
-
|
|
519
|
-
export interface IFhirManagerPGResOptions extends IFhirManagerBaseOptions {
|
|
520
|
-
accessLayer: IDBAccessLayer
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
export interface IFhirManagerPGResEntityOptions extends IFhirManagerBaseOptions {
|
|
524
|
-
accessLayer: IDBAccessLayer
|
|
525
|
-
}
|
|
526
|
-
|
|
527
|
-
export interface IFhirManagerRedisJsonOptions extends IFhirManagerBaseOptions {
|
|
528
|
-
redisUrl: string
|
|
529
|
-
}
|
|
530
|
-
|
|
531
|
-
export enum IFhirPersistenceType {
|
|
532
|
-
postgresResources,
|
|
533
|
-
postgresResourcesEntities,
|
|
534
|
-
redisJson,
|
|
535
|
-
ioredisJson
|
|
536
|
-
}
|
|
537
|
-
|
|
538
|
-
export interface IDALFhirManagerOptions {
|
|
539
|
-
persistenceType: IFhirPersistenceType
|
|
540
|
-
persistenceTypeOptions: IFhirManagerPGResOptions | IFhirManagerPGResEntityOptions | IFhirManagerRedisJsonOptions
|
|
541
|
-
}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { IDALFhirDataAccessManager, IFhirManagerPGResOptions, IFhirManagerPGResEntityOptions, IFhirManagerRedisJsonOptions,
|
|
2
|
-
IDALFhirManagerOptions, IFhirPersistenceType } from './STSFhirTypes'
|
|
3
|
-
import { DALFhirManagerPGRes } from './dalFhirManagerPGRes'
|
|
4
|
-
import { DALFhirManagerPGResEntity } from './dalFhirManagerPGResEntity'
|
|
5
|
-
import { DALFhirManagerRedisJson } from './dalFhirManagerRedisJson'
|
|
6
|
-
import { DALFhirManagerIORedisJson } from './dalFhirManagerIORedisJson'
|
|
7
|
-
|
|
8
|
-
export class DALFhirManager<T> {
|
|
9
|
-
#fhirDataAccessManager: IDALFhirDataAccessManager<T>;
|
|
10
|
-
|
|
11
|
-
constructor(options: IDALFhirManagerOptions) {
|
|
12
|
-
switch (options.persistenceType) {
|
|
13
|
-
case IFhirPersistenceType.postgresResources :
|
|
14
|
-
this.#fhirDataAccessManager = new DALFhirManagerPGRes<T>(options.persistenceTypeOptions as IFhirManagerPGResOptions);
|
|
15
|
-
break;
|
|
16
|
-
case IFhirPersistenceType.postgresResourcesEntities :
|
|
17
|
-
this.#fhirDataAccessManager = new DALFhirManagerPGResEntity<T>(options.persistenceTypeOptions as IFhirManagerPGResEntityOptions);
|
|
18
|
-
break;
|
|
19
|
-
case IFhirPersistenceType.redisJson:
|
|
20
|
-
this.#fhirDataAccessManager = new DALFhirManagerRedisJson<T>(options.persistenceTypeOptions as IFhirManagerRedisJsonOptions);
|
|
21
|
-
break;
|
|
22
|
-
case IFhirPersistenceType.ioredisJson:
|
|
23
|
-
this.#fhirDataAccessManager = new DALFhirManagerIORedisJson<T>(options.persistenceTypeOptions as IFhirManagerRedisJsonOptions);
|
|
24
|
-
break;
|
|
25
|
-
default :
|
|
26
|
-
this.#fhirDataAccessManager = new DALFhirManagerPGRes<T>(options.persistenceTypeOptions as IFhirManagerPGResOptions);
|
|
27
|
-
}
|
|
28
|
-
}
|
|
29
|
-
|
|
30
|
-
get fhirDataAccessManager() {
|
|
31
|
-
return this.#fhirDataAccessManager;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
@@ -1,77 +0,0 @@
|
|
|
1
|
-
/* eslint @typescript-eslint/no-unused-vars: 0 */ // --> OFF
|
|
2
|
-
import { IDomainResource, IDALFhirDataAccessManager, IFhirManagerBaseOptions } from './STSFhirTypes'
|
|
3
|
-
|
|
4
|
-
export abstract class DALFhirManagerBase<T> implements IDALFhirDataAccessManager<T> {
|
|
5
|
-
#options: IFhirManagerBaseOptions;
|
|
6
|
-
|
|
7
|
-
constructor(options: IFhirManagerBaseOptions) {
|
|
8
|
-
this.#options = options;
|
|
9
|
-
}
|
|
10
|
-
|
|
11
|
-
get options() {
|
|
12
|
-
return this.#options;
|
|
13
|
-
}
|
|
14
|
-
|
|
15
|
-
set options(options: IFhirManagerBaseOptions) {
|
|
16
|
-
this.#options = options;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
async Start() {
|
|
20
|
-
|
|
21
|
-
}
|
|
22
|
-
|
|
23
|
-
async Stop() {
|
|
24
|
-
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
GetResourceType(fhir: Partial<T>): string {
|
|
28
|
-
return `${this.#options.resourceName}_${(fhir as Partial<IDomainResource>).id}`;
|
|
29
|
-
}
|
|
30
|
-
|
|
31
|
-
async GetFhirResource(fhir: Partial<T>, ecb?: (fhir: Partial<T>, error: Error) => void): Promise<T | null> {
|
|
32
|
-
return null;
|
|
33
|
-
}
|
|
34
|
-
|
|
35
|
-
async CreateFhirResource(fhir: T, ecb?: (fhir: T, error: Error) => void): Promise<T | null> {
|
|
36
|
-
return null;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
async UpdateFhirResource(fhir: T, ecb?: (fhir: T, error: Error) => void): Promise<T | null> {
|
|
40
|
-
return null;
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
async DeleteFhirResource(fhir: Partial<T>, ecb?: (fhir: Partial<T>, error: Error) => void): Promise<T | null> {
|
|
44
|
-
return null;
|
|
45
|
-
}
|
|
46
|
-
|
|
47
|
-
async GetFhirResources(filters: string[], ecb?: (filters: string[], error: Error) => void): Promise<T[] | null> {
|
|
48
|
-
return null;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
async CreateFhirResources(fhir: T[], ecb?: (fhir: T, error: Error) => void): Promise<(T | null)[]> {
|
|
52
|
-
const promArray: Promise<T | null>[] = [ ];
|
|
53
|
-
fhir.forEach(async (f) => {
|
|
54
|
-
promArray.push(this.CreateFhirResource(f, ecb));
|
|
55
|
-
})
|
|
56
|
-
const promRetVal = await Promise.all(promArray);
|
|
57
|
-
return promRetVal;
|
|
58
|
-
}
|
|
59
|
-
|
|
60
|
-
async UpdateFhirResources(fhir: T[], ecb?: (fhir: T, error: Error) => void): Promise<(T | null)[]> {
|
|
61
|
-
const promArray: Promise<T | null>[] = [ ];
|
|
62
|
-
fhir.forEach(async (f) => {
|
|
63
|
-
promArray.push(this.UpdateFhirResource(f, ecb));
|
|
64
|
-
})
|
|
65
|
-
const promRetVal = await Promise.all(promArray);
|
|
66
|
-
return promRetVal;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
async DeleteFhirResources(fhir: Partial<T>[], ecb?: (fhir: Partial<T>, error: Error) => void): Promise<(T | null)[]> {
|
|
70
|
-
const promArray: Promise<T | null>[] = [ ];
|
|
71
|
-
fhir.forEach(async (f) => {
|
|
72
|
-
promArray.push(this.DeleteFhirResource(f, ecb));
|
|
73
|
-
})
|
|
74
|
-
const promRetVal = await Promise.all(promArray);
|
|
75
|
-
return promRetVal;
|
|
76
|
-
}
|
|
77
|
-
}
|