@digitalmedika/satusehat 0.1.0 → 0.3.0
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/README.md +120 -2
- package/dist/builders/chest-xray-study-builder.d.ts +16 -0
- package/dist/builders/encounter-builder.d.ts +124 -0
- package/dist/builders/encounter-condition-builder.d.ts +28 -0
- package/dist/builders/risk-assessment-builder.d.ts +39 -0
- package/dist/builders/service-request-imaging-study-diagnostic-report-builder.d.ts +49 -0
- package/dist/client/create-client.d.ts +1 -0
- package/dist/client/transport.d.ts +9 -0
- package/dist/core/types.d.ts +160 -0
- package/dist/endpoints/allergy-intolerance.d.ts +720 -0
- package/dist/endpoints/clinical-impression.d.ts +530 -0
- package/dist/endpoints/composition.d.ts +3 -0
- package/dist/endpoints/condition.d.ts +195 -195
- package/dist/endpoints/diagnostic-report.d.ts +70 -70
- package/dist/endpoints/dicom-router.d.ts +6 -0
- package/dist/endpoints/encounter.d.ts +156 -115
- package/dist/endpoints/imaging-study.d.ts +790 -0
- package/dist/endpoints/location.d.ts +30 -30
- package/dist/endpoints/medication-administration.d.ts +910 -0
- package/dist/endpoints/medication-request.d.ts +260 -260
- package/dist/endpoints/nutrition-order.d.ts +1510 -0
- package/dist/endpoints/observation.d.ts +230 -230
- package/dist/endpoints/organization.d.ts +20 -20
- package/dist/endpoints/practitioner-role.d.ts +25 -25
- package/dist/endpoints/procedure.d.ts +215 -215
- package/dist/endpoints/questionnaire-response.d.ts +195 -0
- package/dist/endpoints/risk-assessment.d.ts +770 -0
- package/dist/endpoints/service-request.d.ts +190 -190
- package/dist/endpoints/specimen.d.ts +105 -105
- package/dist/index.d.ts +21 -3
- package/dist/index.js +15 -1
- package/dist/schemas/allergy-intolerance.d.ts +4148 -0
- package/dist/schemas/clinical-impression.d.ts +2666 -0
- package/dist/schemas/composition.d.ts +2914 -0
- package/dist/schemas/condition.d.ts +476 -476
- package/dist/schemas/diagnostic-report.d.ts +172 -172
- package/dist/schemas/encounter.d.ts +1124 -564
- package/dist/schemas/imaging-study.d.ts +4609 -0
- package/dist/schemas/location.d.ts +72 -72
- package/dist/schemas/medication-administration.d.ts +5420 -0
- package/dist/schemas/medication-request.d.ts +1083 -1083
- package/dist/schemas/nutrition-order.d.ts +12261 -0
- package/dist/schemas/observation.d.ts +598 -598
- package/dist/schemas/organization.d.ts +60 -60
- package/dist/schemas/practitioner-role.d.ts +60 -60
- package/dist/schemas/procedure.d.ts +536 -536
- package/dist/schemas/questionnaire-response.d.ts +939 -0
- package/dist/schemas/risk-assessment.d.ts +4591 -0
- package/dist/schemas/service-request.d.ts +470 -470
- package/dist/schemas/specimen.d.ts +312 -312
- package/package.json +8 -1
package/README.md
CHANGED
|
@@ -14,9 +14,15 @@ SDK ini dirancang untuk:
|
|
|
14
14
|
|
|
15
15
|
Helper builder yang saat ini tersedia:
|
|
16
16
|
|
|
17
|
+
- `createEncounterBuilder`
|
|
18
|
+
- `createEncounterConditionBuilder`
|
|
19
|
+
- `createEmergencyEncounterHistory`
|
|
20
|
+
- `createChestXRayStudyBuilder`
|
|
17
21
|
- `createCompleteBloodCountPanelBuilder`
|
|
18
22
|
- `createLaboratoryPanelBuilder`
|
|
19
23
|
- `createOrganizationBuilder`
|
|
24
|
+
- `createRiskAssessmentBuilder`
|
|
25
|
+
- `createServiceRequestImagingStudyDiagnosticReportBuilder`
|
|
20
26
|
- `createServiceRequestSpecimenObservationBuilder`
|
|
21
27
|
|
|
22
28
|
## Installation
|
|
@@ -34,13 +40,82 @@ bun install
|
|
|
34
40
|
## Quick Start
|
|
35
41
|
|
|
36
42
|
```ts
|
|
37
|
-
import {
|
|
43
|
+
import {
|
|
44
|
+
createEncounterBuilder,
|
|
45
|
+
createSatuSehatClientFromEnv,
|
|
46
|
+
} from "@digitalmedika/satusehat";
|
|
38
47
|
|
|
39
48
|
const client = createSatuSehatClientFromEnv();
|
|
40
49
|
|
|
41
|
-
const
|
|
50
|
+
const patientResult = await client.patient.search({
|
|
42
51
|
identifier: "https://fhir.kemkes.go.id/id/nik|9271060312000001",
|
|
43
52
|
});
|
|
53
|
+
|
|
54
|
+
const patient = patientResult.entry?.[0]?.resource;
|
|
55
|
+
|
|
56
|
+
if (!patient?.id) {
|
|
57
|
+
throw new Error("Patient tidak ditemukan");
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
const encounterDraft = createEncounterBuilder({
|
|
61
|
+
preset: "outpatient",
|
|
62
|
+
identifier: {
|
|
63
|
+
system: "http://sys-ids.kemkes.go.id/encounter/10000004",
|
|
64
|
+
use: "official",
|
|
65
|
+
value: "RJ-20240001",
|
|
66
|
+
},
|
|
67
|
+
status: "arrived",
|
|
68
|
+
subject: {
|
|
69
|
+
reference: `Patient/${patient.id}`,
|
|
70
|
+
display: patient.name?.[0]?.text ?? "Pasien SATUSEHAT",
|
|
71
|
+
},
|
|
72
|
+
period: {
|
|
73
|
+
start: "2024-04-01T01:00:00+00:00",
|
|
74
|
+
end: "2024-04-01T02:00:00+00:00",
|
|
75
|
+
},
|
|
76
|
+
reasonCode: {
|
|
77
|
+
coding: [
|
|
78
|
+
{
|
|
79
|
+
system: "http://terminology.hl7.org/CodeSystem/encounter-reason",
|
|
80
|
+
code: "185349003",
|
|
81
|
+
display: "Encounter for check up",
|
|
82
|
+
},
|
|
83
|
+
],
|
|
84
|
+
},
|
|
85
|
+
diagnosis: {
|
|
86
|
+
condition: {
|
|
87
|
+
reference: "Condition/4bbbe654-14f5-4ab3-a36e-a1e307f67bb8",
|
|
88
|
+
},
|
|
89
|
+
use: {
|
|
90
|
+
coding: [
|
|
91
|
+
{
|
|
92
|
+
system: "https://www.hl7.org/fhir/Codesystem-diagnosis-role",
|
|
93
|
+
code: "AD",
|
|
94
|
+
display: "Admission diagnosis",
|
|
95
|
+
},
|
|
96
|
+
],
|
|
97
|
+
},
|
|
98
|
+
rank: 1,
|
|
99
|
+
},
|
|
100
|
+
location: {
|
|
101
|
+
location: {
|
|
102
|
+
reference: "Location/408ba28c-3115-4df5-85c6-60f15b44e7fa",
|
|
103
|
+
display: "Poliklinik Rawat Jalan",
|
|
104
|
+
},
|
|
105
|
+
status: "active",
|
|
106
|
+
},
|
|
107
|
+
serviceProvider: {
|
|
108
|
+
reference: "Organization/10000004",
|
|
109
|
+
display: "RS SATUSEHAT",
|
|
110
|
+
},
|
|
111
|
+
}).build();
|
|
112
|
+
|
|
113
|
+
const encounter = await client.encounter.create(encounterDraft);
|
|
114
|
+
|
|
115
|
+
console.log({
|
|
116
|
+
patientId: patient.id,
|
|
117
|
+
encounterId: encounter.id,
|
|
118
|
+
});
|
|
44
119
|
```
|
|
45
120
|
|
|
46
121
|
## Environment Variables
|
|
@@ -52,6 +127,7 @@ Variable utama:
|
|
|
52
127
|
- `SATUSEHAT_ENV`
|
|
53
128
|
- `SATUSEHAT_BASE_URL`
|
|
54
129
|
- `SATUSEHAT_AUTH_BASE_URL`
|
|
130
|
+
- `SATUSEHAT_DICOM_BASE_URL`
|
|
55
131
|
- `SATUSEHAT_CLIENT_ID`
|
|
56
132
|
- `SATUSEHAT_CLIENT_SECRET`
|
|
57
133
|
- `SATUSEHAT_TOKEN_CACHE_FILE`
|
|
@@ -60,10 +136,17 @@ Variable utama:
|
|
|
60
136
|
|
|
61
137
|
Saat ini resource yang sudah tersedia:
|
|
62
138
|
|
|
139
|
+
- `allergyIntolerance`
|
|
140
|
+
- `clinicalImpression`
|
|
141
|
+
- `composition`
|
|
63
142
|
- `condition`
|
|
143
|
+
- `dicomRouter`
|
|
64
144
|
- `diagnosticReport`
|
|
65
145
|
- `encounter`
|
|
146
|
+
- `imagingStudy`
|
|
147
|
+
- `medicationAdministration`
|
|
66
148
|
- `observation`
|
|
149
|
+
- `nutritionOrder`
|
|
67
150
|
- `procedure`
|
|
68
151
|
- `medication`
|
|
69
152
|
- `medicationRequest`
|
|
@@ -74,6 +157,8 @@ Saat ini resource yang sudah tersedia:
|
|
|
74
157
|
- `location`
|
|
75
158
|
- `practitioner`
|
|
76
159
|
- `practitionerRole`
|
|
160
|
+
- `questionnaireResponse`
|
|
161
|
+
- `riskAssessment`
|
|
77
162
|
|
|
78
163
|
## Token Handling
|
|
79
164
|
|
|
@@ -106,25 +191,58 @@ Untuk environment `sandbox`, smoke test akan memakai dummy patient resmi SATUSEH
|
|
|
106
191
|
- [Getting Started](./docs/getting-started.md)
|
|
107
192
|
- [Authentication](./docs/authentication.md)
|
|
108
193
|
- [Errors](./docs/errors.md)
|
|
194
|
+
- [AllergyIntolerance](./docs/resources/allergy-intolerance.md)
|
|
195
|
+
- [ClinicalImpression](./docs/resources/clinical-impression.md)
|
|
196
|
+
- [Composition](./docs/resources/composition.md)
|
|
109
197
|
- [Condition](./docs/resources/condition.md)
|
|
198
|
+
- [DICOM Router](./docs/resources/dicom-router.md)
|
|
199
|
+
- [QuestionnaireResponse](./docs/resources/questionnaire-response.md)
|
|
200
|
+
- [RiskAssessment](./docs/resources/risk-assessment.md)
|
|
110
201
|
- [DiagnosticReport](./docs/resources/diagnostic-report.md)
|
|
202
|
+
- [ImagingStudy](./docs/resources/imaging-study.md)
|
|
203
|
+
- [Encounter Builder](./docs/helpers/encounter-builder.md)
|
|
204
|
+
- [Encounter -> Condition Builder](./docs/helpers/encounter-condition-builder.md)
|
|
111
205
|
- [Patient](./docs/resources/patient.md)
|
|
112
206
|
- [Encounter](./docs/resources/encounter.md)
|
|
113
207
|
- [Procedure](./docs/resources/procedure.md)
|
|
114
208
|
- [Observation](./docs/resources/observation.md)
|
|
209
|
+
- [MedicationAdministration](./docs/resources/medication-administration.md)
|
|
210
|
+
- [NutritionOrder](./docs/resources/nutrition-order.md)
|
|
115
211
|
- [Medication](./docs/resources/medication.md)
|
|
116
212
|
- [MedicationRequest](./docs/resources/medication-request.md)
|
|
117
213
|
- [ServiceRequest](./docs/resources/service-request.md)
|
|
118
214
|
- [Specimen](./docs/resources/specimen.md)
|
|
119
215
|
- [ServiceRequest -> Specimen -> Observation Builder](./docs/helpers/service-request-specimen-observation-builder.md)
|
|
216
|
+
- [ServiceRequest -> ImagingStudy -> DiagnosticReport Builder](./docs/helpers/service-request-imaging-study-diagnostic-report-builder.md)
|
|
217
|
+
- [Chest X-Ray Study Builder](./docs/helpers/chest-xray-study-builder.md)
|
|
120
218
|
- [Laboratory Panel Builder](./docs/helpers/laboratory-panel-builder.md)
|
|
121
219
|
- [CBC Panel Builder](./docs/helpers/cbc-panel-builder.md)
|
|
220
|
+
- [Risk Assessment Builder](./docs/helpers/risk-assessment-builder.md)
|
|
122
221
|
- [Organization](./docs/resources/organization.md)
|
|
123
222
|
- [Location](./docs/resources/location.md)
|
|
124
223
|
- [Practitioner](./docs/resources/practitioner.md)
|
|
125
224
|
- [PractitionerRole](./docs/resources/practitioner-role.md)
|
|
126
225
|
- [Planning](./docs/planning.md)
|
|
127
226
|
|
|
227
|
+
## DICOM Router
|
|
228
|
+
|
|
229
|
+
SDK ini juga mendukung download file `docker-compose.yml` untuk DICOM Router SATUSEHAT:
|
|
230
|
+
|
|
231
|
+
```ts
|
|
232
|
+
const dockerCompose = await client.dicomRouter.downloadConfig();
|
|
233
|
+
```
|
|
234
|
+
|
|
235
|
+
Secara default SDK akan memakai endpoint berikut:
|
|
236
|
+
|
|
237
|
+
- sandbox: `https://api-satusehat-stg.dto.kemkes.go.id/dicom-router`
|
|
238
|
+
- production: `https://api-satusehat.kemkes.go.id/dicom-router`
|
|
239
|
+
|
|
240
|
+
## Buy Us a Coffee
|
|
241
|
+
|
|
242
|
+
Kalau project ini membantu, kamu bisa dukung Digital Medika lewat Saweria:
|
|
243
|
+
|
|
244
|
+
- [Buy us a coffee on Saweria](https://saweria.co/digitalmedika)
|
|
245
|
+
|
|
128
246
|
## Premium Support
|
|
129
247
|
|
|
130
248
|
Untuk premium support dan implementasi, hubungi:
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { type ServiceRequestImagingStudyDiagnosticReportBuilder } from "./service-request-imaging-study-diagnostic-report-builder";
|
|
2
|
+
import type { Reference } from "../schemas/common";
|
|
3
|
+
import type { DiagnosticReportCreateInput } from "../schemas/diagnostic-report";
|
|
4
|
+
import type { ImagingStudyCreateInput } from "../schemas/imaging-study";
|
|
5
|
+
import type { ServiceRequestCreateInput } from "../schemas/service-request";
|
|
6
|
+
export interface ChestXRayStudyBuilderInput {
|
|
7
|
+
subject: Reference;
|
|
8
|
+
encounter: Reference;
|
|
9
|
+
organizationId: string;
|
|
10
|
+
accessionNumber: string;
|
|
11
|
+
identifierUse?: string;
|
|
12
|
+
serviceRequest?: Partial<Omit<ServiceRequestCreateInput, "resourceType" | "subject" | "encounter" | "status" | "intent" | "code">>;
|
|
13
|
+
imagingStudy?: Partial<Omit<ImagingStudyCreateInput, "resourceType" | "subject" | "encounter" | "basedOn" | "identifier" | "status" | "modality">>;
|
|
14
|
+
diagnosticReport?: Partial<Omit<DiagnosticReportCreateInput, "resourceType" | "subject" | "encounter" | "status" | "code">>;
|
|
15
|
+
}
|
|
16
|
+
export declare function createChestXRayStudyBuilder(input: ChestXRayStudyBuilderInput): ServiceRequestImagingStudyDiagnosticReportBuilder;
|
|
@@ -0,0 +1,124 @@
|
|
|
1
|
+
import type { Reference } from "../schemas/common";
|
|
2
|
+
import type { EncounterAdmitSource, EncounterClass, EncounterClassHistory, EncounterCreateInput, EncounterDischargeDisposition, EncounterDiagnosis, EncounterHospitalization, EncounterIdentifier, EncounterLocation, EncounterLocationServiceClassExtension, EncounterParticipant, EncounterStatus, EncounterStatusHistory } from "../schemas/encounter";
|
|
3
|
+
declare const ENCOUNTER_CLASS_PRESETS: {
|
|
4
|
+
outpatient: {
|
|
5
|
+
system: string;
|
|
6
|
+
code: string;
|
|
7
|
+
display: string;
|
|
8
|
+
};
|
|
9
|
+
inpatient: {
|
|
10
|
+
system: string;
|
|
11
|
+
code: string;
|
|
12
|
+
display: string;
|
|
13
|
+
};
|
|
14
|
+
emergency: {
|
|
15
|
+
system: string;
|
|
16
|
+
code: string;
|
|
17
|
+
display: string;
|
|
18
|
+
};
|
|
19
|
+
};
|
|
20
|
+
type EncounterBuilderCommonInput = {
|
|
21
|
+
identifier: EncounterIdentifier | EncounterIdentifier[];
|
|
22
|
+
status: EncounterStatus;
|
|
23
|
+
statusHistory?: EncounterStatusHistory[];
|
|
24
|
+
classHistory?: EncounterClassHistory[];
|
|
25
|
+
type?: NonNullable<EncounterCreateInput["type"]>;
|
|
26
|
+
serviceType?: EncounterCreateInput["serviceType"];
|
|
27
|
+
priority?: EncounterCreateInput["priority"];
|
|
28
|
+
subject: Reference;
|
|
29
|
+
episodeOfCare?: Reference[];
|
|
30
|
+
basedOn?: Reference[];
|
|
31
|
+
participant?: EncounterParticipant[];
|
|
32
|
+
period: EncounterCreateInput["period"];
|
|
33
|
+
length?: EncounterCreateInput["length"];
|
|
34
|
+
reasonCode: EncounterCreateInput["reasonCode"][number] | EncounterCreateInput["reasonCode"];
|
|
35
|
+
reasonReference?: Reference[];
|
|
36
|
+
diagnosis: EncounterDiagnosis | EncounterDiagnosis[];
|
|
37
|
+
account?: Reference[];
|
|
38
|
+
hospitalization?: EncounterHospitalization;
|
|
39
|
+
location: EncounterLocation | EncounterLocation[];
|
|
40
|
+
serviceProvider: Reference;
|
|
41
|
+
partOf?: Reference;
|
|
42
|
+
};
|
|
43
|
+
type EncounterBuilderPresetInput = EncounterBuilderCommonInput & {
|
|
44
|
+
preset: keyof typeof ENCOUNTER_CLASS_PRESETS;
|
|
45
|
+
encounterClass?: never;
|
|
46
|
+
};
|
|
47
|
+
type EncounterBuilderCustomClassInput = EncounterBuilderCommonInput & {
|
|
48
|
+
preset?: never;
|
|
49
|
+
encounterClass: EncounterClass;
|
|
50
|
+
};
|
|
51
|
+
export type EncounterBuilderPreset = keyof typeof ENCOUNTER_CLASS_PRESETS;
|
|
52
|
+
export type EncounterBuilderInput = EncounterBuilderPresetInput | EncounterBuilderCustomClassInput;
|
|
53
|
+
export type EncounterHospitalizationHelperInput = Omit<EncounterHospitalization, "admitSource" | "dischargeDisposition"> & {
|
|
54
|
+
admitSource?: EncounterAdmitSource | string;
|
|
55
|
+
dischargeDisposition?: EncounterDischargeDisposition | string;
|
|
56
|
+
};
|
|
57
|
+
export interface EmergencyEncounterStatusStageInput {
|
|
58
|
+
status: EncounterStatus;
|
|
59
|
+
start: string;
|
|
60
|
+
}
|
|
61
|
+
export type EmergencyEncounterClassStageInput = {
|
|
62
|
+
start: string;
|
|
63
|
+
preset: EncounterBuilderPreset;
|
|
64
|
+
encounterClass?: never;
|
|
65
|
+
} | {
|
|
66
|
+
start: string;
|
|
67
|
+
preset?: never;
|
|
68
|
+
encounterClass: EncounterClass;
|
|
69
|
+
};
|
|
70
|
+
export interface EmergencyEncounterHistoryInput {
|
|
71
|
+
statusStages: [
|
|
72
|
+
EmergencyEncounterStatusStageInput,
|
|
73
|
+
...EmergencyEncounterStatusStageInput[]
|
|
74
|
+
];
|
|
75
|
+
periodEnd: string;
|
|
76
|
+
classStages?: [
|
|
77
|
+
EmergencyEncounterClassStageInput,
|
|
78
|
+
...EmergencyEncounterClassStageInput[]
|
|
79
|
+
];
|
|
80
|
+
}
|
|
81
|
+
export interface EmergencyEncounterHistoryResult {
|
|
82
|
+
status: EncounterStatus;
|
|
83
|
+
period: EncounterCreateInput["period"];
|
|
84
|
+
encounterClass: EncounterClass;
|
|
85
|
+
statusHistory: EncounterStatusHistory[];
|
|
86
|
+
classHistory: EncounterClassHistory[];
|
|
87
|
+
}
|
|
88
|
+
export declare function createEncounterHospitalization(input: EncounterHospitalizationHelperInput): EncounterHospitalization;
|
|
89
|
+
export declare function createEmergencyEncounterHistory(input: EmergencyEncounterHistoryInput): EmergencyEncounterHistoryResult;
|
|
90
|
+
export declare function createEncounterLocationServiceClassExtension(valueCode: string): EncounterLocationServiceClassExtension;
|
|
91
|
+
export declare function withEncounterLocationServiceClass(location: EncounterLocation, valueCode: string): EncounterLocation;
|
|
92
|
+
export declare class EncounterBuilder {
|
|
93
|
+
private draft;
|
|
94
|
+
constructor(input: EncounterBuilderInput);
|
|
95
|
+
addAccount(reference: Reference): this;
|
|
96
|
+
addBasedOn(reference: Reference): this;
|
|
97
|
+
addDiagnosis(diagnosis: EncounterDiagnosis): this;
|
|
98
|
+
addEpisodeOfCare(reference: Reference): this;
|
|
99
|
+
addIdentifier(identifier: EncounterIdentifier): this;
|
|
100
|
+
addLocation(location: EncounterLocation): this;
|
|
101
|
+
addParticipant(participant: EncounterParticipant): this;
|
|
102
|
+
addReasonCode(reasonCode: EncounterCreateInput["reasonCode"][number]): this;
|
|
103
|
+
addReasonReference(reference: Reference): this;
|
|
104
|
+
addStatusHistory(statusHistory: EncounterStatusHistory): this;
|
|
105
|
+
addClassHistory(classHistory: EncounterClassHistory): this;
|
|
106
|
+
addType(type: NonNullable<EncounterCreateInput["type"]>[number]): this;
|
|
107
|
+
merge(input: Partial<Omit<EncounterCreateInput, "resourceType">>): this;
|
|
108
|
+
setClass(value: EncounterClass): this;
|
|
109
|
+
setHospitalization(value: EncounterHospitalization): this;
|
|
110
|
+
setInpatientHospitalization(input: EncounterHospitalizationHelperInput): this;
|
|
111
|
+
setLength(value: NonNullable<EncounterCreateInput["length"]>): this;
|
|
112
|
+
setPartOf(reference: Reference): this;
|
|
113
|
+
setPeriod(value: EncounterCreateInput["period"]): this;
|
|
114
|
+
setPreset(preset: EncounterBuilderPreset): this;
|
|
115
|
+
setPriority(value: NonNullable<EncounterCreateInput["priority"]>): this;
|
|
116
|
+
setServiceProvider(reference: Reference): this;
|
|
117
|
+
setServiceType(value: NonNullable<EncounterCreateInput["serviceType"]>): this;
|
|
118
|
+
setLocationServiceClass(locationIndex: number, valueCode: string): this;
|
|
119
|
+
setStatus(value: EncounterStatus): this;
|
|
120
|
+
setSubject(reference: Reference): this;
|
|
121
|
+
build(): EncounterCreateInput;
|
|
122
|
+
}
|
|
123
|
+
export declare function createEncounterBuilder(input: EncounterBuilderInput): EncounterBuilder;
|
|
124
|
+
export {};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import type { Reference } from "../schemas/common";
|
|
2
|
+
import type { ConditionCreateInput, ConditionNote } from "../schemas/condition";
|
|
3
|
+
import type { EncounterDiagnosis } from "../schemas/encounter";
|
|
4
|
+
type ConditionMutableInput = Partial<Omit<ConditionCreateInput, "resourceType" | "subject" | "encounter">>;
|
|
5
|
+
export interface EncounterConditionBuilderInput {
|
|
6
|
+
subject: Reference;
|
|
7
|
+
encounter: Reference;
|
|
8
|
+
condition: Pick<ConditionCreateInput, "code"> & ConditionMutableInput;
|
|
9
|
+
}
|
|
10
|
+
export interface EncounterDiagnosisBuildLinks {
|
|
11
|
+
conditionId?: string;
|
|
12
|
+
conditionReference?: Reference;
|
|
13
|
+
use?: EncounterDiagnosis["use"];
|
|
14
|
+
rank?: number;
|
|
15
|
+
}
|
|
16
|
+
export declare class EncounterConditionBuilder {
|
|
17
|
+
private conditionDraft;
|
|
18
|
+
constructor(input: EncounterConditionBuilderInput);
|
|
19
|
+
setSubject(subject: Reference): this;
|
|
20
|
+
setEncounter(encounter: Reference): this;
|
|
21
|
+
mergeCondition(input: ConditionMutableInput): this;
|
|
22
|
+
addCategory(category: NonNullable<ConditionCreateInput["category"]>[number]): this;
|
|
23
|
+
addNote(note: ConditionNote): this;
|
|
24
|
+
buildCondition(): ConditionCreateInput;
|
|
25
|
+
buildEncounterDiagnosis(links?: EncounterDiagnosisBuildLinks): EncounterDiagnosis;
|
|
26
|
+
}
|
|
27
|
+
export declare function createEncounterConditionBuilder(input: EncounterConditionBuilderInput): EncounterConditionBuilder;
|
|
28
|
+
export {};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
import type { Reference } from "../schemas/common";
|
|
2
|
+
import type { RiskAssessmentCreateInput, RiskAssessmentNote, RiskAssessmentPrediction, RiskAssessmentStatus } from "../schemas/risk-assessment";
|
|
3
|
+
export interface RiskAssessmentBuilderInput {
|
|
4
|
+
subject: Reference;
|
|
5
|
+
status: RiskAssessmentStatus;
|
|
6
|
+
code?: RiskAssessmentCreateInput["code"];
|
|
7
|
+
encounter?: Reference;
|
|
8
|
+
occurrenceDateTime?: string;
|
|
9
|
+
performer?: Reference;
|
|
10
|
+
condition?: Reference;
|
|
11
|
+
reasonCode?: RiskAssessmentCreateInput["reasonCode"];
|
|
12
|
+
reasonReference?: Reference;
|
|
13
|
+
method?: RiskAssessmentCreateInput["method"];
|
|
14
|
+
mitigation?: string;
|
|
15
|
+
}
|
|
16
|
+
export declare class RiskAssessmentBuilder {
|
|
17
|
+
private draft;
|
|
18
|
+
constructor(input: RiskAssessmentBuilderInput);
|
|
19
|
+
addBasis(reference: Reference): this;
|
|
20
|
+
addIdentifier(identifier: NonNullable<RiskAssessmentCreateInput["identifier"]>[number]): this;
|
|
21
|
+
addNote(note: RiskAssessmentNote): this;
|
|
22
|
+
addPrediction(prediction: RiskAssessmentPrediction): this;
|
|
23
|
+
merge(input: Partial<Omit<RiskAssessmentCreateInput, "resourceType">>): this;
|
|
24
|
+
setBasedOn(reference: Reference): this;
|
|
25
|
+
setCode(code: NonNullable<RiskAssessmentCreateInput["code"]>): this;
|
|
26
|
+
setCondition(reference: Reference): this;
|
|
27
|
+
setEncounter(reference: Reference): this;
|
|
28
|
+
setMethod(method: NonNullable<RiskAssessmentCreateInput["method"]>): this;
|
|
29
|
+
setMitigation(mitigation: string): this;
|
|
30
|
+
setOccurrenceDateTime(value: string): this;
|
|
31
|
+
setOccurrencePeriod(value: NonNullable<RiskAssessmentCreateInput["occurrencePeriod"]>): this;
|
|
32
|
+
setPerformer(reference: Reference): this;
|
|
33
|
+
setReasonCode(reasonCode: NonNullable<RiskAssessmentCreateInput["reasonCode"]>): this;
|
|
34
|
+
setReasonReference(reference: Reference): this;
|
|
35
|
+
setStatus(status: RiskAssessmentStatus): this;
|
|
36
|
+
setSubject(reference: Reference): this;
|
|
37
|
+
build(): RiskAssessmentCreateInput;
|
|
38
|
+
}
|
|
39
|
+
export declare function createRiskAssessmentBuilder(input: RiskAssessmentBuilderInput): RiskAssessmentBuilder;
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import type { Reference } from "../schemas/common";
|
|
2
|
+
import type { DiagnosticReportCreateInput, DiagnosticReportMedia } from "../schemas/diagnostic-report";
|
|
3
|
+
import type { ImagingStudyCreateInput, ImagingStudyNote, ImagingStudySeries } from "../schemas/imaging-study";
|
|
4
|
+
import type { ServiceRequestCreateInput, ServiceRequestNote } from "../schemas/service-request";
|
|
5
|
+
export interface ServiceRequestImagingStudyDiagnosticReportBuilderInput {
|
|
6
|
+
subject: Reference;
|
|
7
|
+
encounter: Reference;
|
|
8
|
+
serviceRequest: Pick<ServiceRequestCreateInput, "status" | "intent" | "code"> & Partial<Omit<ServiceRequestCreateInput, "resourceType" | "subject" | "encounter">>;
|
|
9
|
+
imagingStudy: Pick<ImagingStudyCreateInput, "identifier" | "status" | "modality"> & Partial<Omit<ImagingStudyCreateInput, "resourceType" | "subject" | "encounter" | "basedOn">>;
|
|
10
|
+
diagnosticReport: Pick<DiagnosticReportCreateInput, "status" | "code"> & Partial<Omit<DiagnosticReportCreateInput, "resourceType" | "subject" | "encounter">>;
|
|
11
|
+
}
|
|
12
|
+
export interface RadiologyServiceRequestBuildLinks {
|
|
13
|
+
serviceRequestId?: string;
|
|
14
|
+
serviceRequestReference?: Reference;
|
|
15
|
+
}
|
|
16
|
+
export interface RadiologyImagingStudyBuildLinks extends RadiologyServiceRequestBuildLinks {
|
|
17
|
+
}
|
|
18
|
+
export interface RadiologyDiagnosticReportBuildLinks extends RadiologyServiceRequestBuildLinks {
|
|
19
|
+
imagingStudyId?: string;
|
|
20
|
+
imagingStudyIds?: string[];
|
|
21
|
+
imagingStudyReference?: Reference;
|
|
22
|
+
imagingStudyReferences?: Reference[];
|
|
23
|
+
}
|
|
24
|
+
type ServiceRequestMutableInput = Partial<Omit<ServiceRequestCreateInput, "resourceType" | "subject" | "encounter">>;
|
|
25
|
+
type ImagingStudyDraftInput = Pick<ImagingStudyCreateInput, "identifier" | "status" | "modality"> & Partial<Omit<ImagingStudyCreateInput, "resourceType" | "subject" | "encounter" | "basedOn">>;
|
|
26
|
+
type ImagingStudyMutableInput = Partial<Omit<ImagingStudyDraftInput, "identifier" | "status" | "modality">> & Partial<Pick<ImagingStudyDraftInput, "identifier" | "status" | "modality">>;
|
|
27
|
+
type DiagnosticReportMutableInput = Partial<Omit<DiagnosticReportCreateInput, "resourceType" | "subject" | "encounter">>;
|
|
28
|
+
export declare class ServiceRequestImagingStudyDiagnosticReportBuilder {
|
|
29
|
+
private serviceRequestDraft;
|
|
30
|
+
private imagingStudyDraft;
|
|
31
|
+
private diagnosticReportDraft;
|
|
32
|
+
private subject;
|
|
33
|
+
private encounter;
|
|
34
|
+
constructor(input: ServiceRequestImagingStudyDiagnosticReportBuilderInput);
|
|
35
|
+
setSubject(subject: Reference): this;
|
|
36
|
+
setEncounter(encounter: Reference): this;
|
|
37
|
+
mergeServiceRequest(input: ServiceRequestMutableInput): this;
|
|
38
|
+
mergeImagingStudy(input: ImagingStudyMutableInput): this;
|
|
39
|
+
mergeDiagnosticReport(input: DiagnosticReportMutableInput): this;
|
|
40
|
+
addServiceRequestNote(note: ServiceRequestNote): this;
|
|
41
|
+
addImagingStudyNote(note: ImagingStudyNote): this;
|
|
42
|
+
addImagingStudySeries(series: ImagingStudySeries): this;
|
|
43
|
+
addDiagnosticReportMedia(media: DiagnosticReportMedia): this;
|
|
44
|
+
buildServiceRequest(): ServiceRequestCreateInput;
|
|
45
|
+
buildImagingStudy(links?: RadiologyImagingStudyBuildLinks): ImagingStudyCreateInput;
|
|
46
|
+
buildDiagnosticReport(links?: RadiologyDiagnosticReportBuildLinks): DiagnosticReportCreateInput;
|
|
47
|
+
}
|
|
48
|
+
export declare function createServiceRequestImagingStudyDiagnosticReportBuilder(input: ServiceRequestImagingStudyDiagnosticReportBuilderInput): ServiceRequestImagingStudyDiagnosticReportBuilder;
|
|
49
|
+
export {};
|
|
@@ -3,3 +3,4 @@ export declare function createSatuSehatClient(config?: SatuSehatClientConfig): S
|
|
|
3
3
|
export declare function createSatuSehatClientFromEnv(env?: SatuSehatEnvSource, overrides?: Omit<SatuSehatClientConfig, "environment" | "baseUrl" | "authBaseUrl" | "credentials">): SatuSehatClient;
|
|
4
4
|
export declare function resolveSatuSehatBaseUrl(environment: SatuSehatEnvironment): string;
|
|
5
5
|
export declare function resolveSatuSehatAuthBaseUrl(environment: SatuSehatEnvironment): string;
|
|
6
|
+
export declare function resolveSatuSehatDicomBaseUrl(environment: SatuSehatEnvironment): string;
|
|
@@ -20,8 +20,17 @@ export interface RequestOptions<TQuerySchema extends ZodTypeAny | undefined, TBo
|
|
|
20
20
|
signal?: AbortSignal;
|
|
21
21
|
responseSchema: TResponseSchema;
|
|
22
22
|
}
|
|
23
|
+
export interface TextRequestOptions<TQuerySchema extends ZodTypeAny | undefined> {
|
|
24
|
+
method: "GET" | "POST" | "PUT" | "PATCH" | "DELETE";
|
|
25
|
+
path: string;
|
|
26
|
+
query?: unknown;
|
|
27
|
+
querySchema?: TQuerySchema;
|
|
28
|
+
headers?: HeadersInit;
|
|
29
|
+
signal?: AbortSignal;
|
|
30
|
+
}
|
|
23
31
|
export interface Transport {
|
|
24
32
|
request<TQuerySchema extends ZodTypeAny | undefined, TBodySchema extends ZodTypeAny | undefined, TResponseSchema extends ZodTypeAny>(options: RequestOptions<TQuerySchema, TBodySchema, TResponseSchema>): Promise<InferSchema<TResponseSchema>>;
|
|
33
|
+
requestText<TQuerySchema extends ZodTypeAny | undefined>(options: TextRequestOptions<TQuerySchema>): Promise<string>;
|
|
25
34
|
}
|
|
26
35
|
type InferSchema<TSchema extends ZodTypeAny> = TSchema["_output"];
|
|
27
36
|
export declare function createTransport(options: TransportOptions): Transport;
|