@digitalmedika/satusehat 0.1.0 → 0.2.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 +118 -2
- package/dist/builders/chest-xray-study-builder.d.ts +16 -0
- package/dist/builders/encounter-builder.d.ts +124 -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 +19 -3
- package/dist/index.js +13 -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,14 @@ SDK ini dirancang untuk:
|
|
|
14
14
|
|
|
15
15
|
Helper builder yang saat ini tersedia:
|
|
16
16
|
|
|
17
|
+
- `createEncounterBuilder`
|
|
18
|
+
- `createEmergencyEncounterHistory`
|
|
19
|
+
- `createChestXRayStudyBuilder`
|
|
17
20
|
- `createCompleteBloodCountPanelBuilder`
|
|
18
21
|
- `createLaboratoryPanelBuilder`
|
|
19
22
|
- `createOrganizationBuilder`
|
|
23
|
+
- `createRiskAssessmentBuilder`
|
|
24
|
+
- `createServiceRequestImagingStudyDiagnosticReportBuilder`
|
|
20
25
|
- `createServiceRequestSpecimenObservationBuilder`
|
|
21
26
|
|
|
22
27
|
## Installation
|
|
@@ -34,13 +39,82 @@ bun install
|
|
|
34
39
|
## Quick Start
|
|
35
40
|
|
|
36
41
|
```ts
|
|
37
|
-
import {
|
|
42
|
+
import {
|
|
43
|
+
createEncounterBuilder,
|
|
44
|
+
createSatuSehatClientFromEnv,
|
|
45
|
+
} from "@digitalmedika/satusehat";
|
|
38
46
|
|
|
39
47
|
const client = createSatuSehatClientFromEnv();
|
|
40
48
|
|
|
41
|
-
const
|
|
49
|
+
const patientResult = await client.patient.search({
|
|
42
50
|
identifier: "https://fhir.kemkes.go.id/id/nik|9271060312000001",
|
|
43
51
|
});
|
|
52
|
+
|
|
53
|
+
const patient = patientResult.entry?.[0]?.resource;
|
|
54
|
+
|
|
55
|
+
if (!patient?.id) {
|
|
56
|
+
throw new Error("Patient tidak ditemukan");
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
const encounterDraft = createEncounterBuilder({
|
|
60
|
+
preset: "outpatient",
|
|
61
|
+
identifier: {
|
|
62
|
+
system: "http://sys-ids.kemkes.go.id/encounter/10000004",
|
|
63
|
+
use: "official",
|
|
64
|
+
value: "RJ-20240001",
|
|
65
|
+
},
|
|
66
|
+
status: "arrived",
|
|
67
|
+
subject: {
|
|
68
|
+
reference: `Patient/${patient.id}`,
|
|
69
|
+
display: patient.name?.[0]?.text ?? "Pasien SATUSEHAT",
|
|
70
|
+
},
|
|
71
|
+
period: {
|
|
72
|
+
start: "2024-04-01T01:00:00+00:00",
|
|
73
|
+
end: "2024-04-01T02:00:00+00:00",
|
|
74
|
+
},
|
|
75
|
+
reasonCode: {
|
|
76
|
+
coding: [
|
|
77
|
+
{
|
|
78
|
+
system: "http://terminology.hl7.org/CodeSystem/encounter-reason",
|
|
79
|
+
code: "185349003",
|
|
80
|
+
display: "Encounter for check up",
|
|
81
|
+
},
|
|
82
|
+
],
|
|
83
|
+
},
|
|
84
|
+
diagnosis: {
|
|
85
|
+
condition: {
|
|
86
|
+
reference: "Condition/4bbbe654-14f5-4ab3-a36e-a1e307f67bb8",
|
|
87
|
+
},
|
|
88
|
+
use: {
|
|
89
|
+
coding: [
|
|
90
|
+
{
|
|
91
|
+
system: "https://www.hl7.org/fhir/Codesystem-diagnosis-role",
|
|
92
|
+
code: "AD",
|
|
93
|
+
display: "Admission diagnosis",
|
|
94
|
+
},
|
|
95
|
+
],
|
|
96
|
+
},
|
|
97
|
+
rank: 1,
|
|
98
|
+
},
|
|
99
|
+
location: {
|
|
100
|
+
location: {
|
|
101
|
+
reference: "Location/408ba28c-3115-4df5-85c6-60f15b44e7fa",
|
|
102
|
+
display: "Poliklinik Rawat Jalan",
|
|
103
|
+
},
|
|
104
|
+
status: "active",
|
|
105
|
+
},
|
|
106
|
+
serviceProvider: {
|
|
107
|
+
reference: "Organization/10000004",
|
|
108
|
+
display: "RS SATUSEHAT",
|
|
109
|
+
},
|
|
110
|
+
}).build();
|
|
111
|
+
|
|
112
|
+
const encounter = await client.encounter.create(encounterDraft);
|
|
113
|
+
|
|
114
|
+
console.log({
|
|
115
|
+
patientId: patient.id,
|
|
116
|
+
encounterId: encounter.id,
|
|
117
|
+
});
|
|
44
118
|
```
|
|
45
119
|
|
|
46
120
|
## Environment Variables
|
|
@@ -52,6 +126,7 @@ Variable utama:
|
|
|
52
126
|
- `SATUSEHAT_ENV`
|
|
53
127
|
- `SATUSEHAT_BASE_URL`
|
|
54
128
|
- `SATUSEHAT_AUTH_BASE_URL`
|
|
129
|
+
- `SATUSEHAT_DICOM_BASE_URL`
|
|
55
130
|
- `SATUSEHAT_CLIENT_ID`
|
|
56
131
|
- `SATUSEHAT_CLIENT_SECRET`
|
|
57
132
|
- `SATUSEHAT_TOKEN_CACHE_FILE`
|
|
@@ -60,10 +135,17 @@ Variable utama:
|
|
|
60
135
|
|
|
61
136
|
Saat ini resource yang sudah tersedia:
|
|
62
137
|
|
|
138
|
+
- `allergyIntolerance`
|
|
139
|
+
- `clinicalImpression`
|
|
140
|
+
- `composition`
|
|
63
141
|
- `condition`
|
|
142
|
+
- `dicomRouter`
|
|
64
143
|
- `diagnosticReport`
|
|
65
144
|
- `encounter`
|
|
145
|
+
- `imagingStudy`
|
|
146
|
+
- `medicationAdministration`
|
|
66
147
|
- `observation`
|
|
148
|
+
- `nutritionOrder`
|
|
67
149
|
- `procedure`
|
|
68
150
|
- `medication`
|
|
69
151
|
- `medicationRequest`
|
|
@@ -74,6 +156,8 @@ Saat ini resource yang sudah tersedia:
|
|
|
74
156
|
- `location`
|
|
75
157
|
- `practitioner`
|
|
76
158
|
- `practitionerRole`
|
|
159
|
+
- `questionnaireResponse`
|
|
160
|
+
- `riskAssessment`
|
|
77
161
|
|
|
78
162
|
## Token Handling
|
|
79
163
|
|
|
@@ -106,25 +190,57 @@ Untuk environment `sandbox`, smoke test akan memakai dummy patient resmi SATUSEH
|
|
|
106
190
|
- [Getting Started](./docs/getting-started.md)
|
|
107
191
|
- [Authentication](./docs/authentication.md)
|
|
108
192
|
- [Errors](./docs/errors.md)
|
|
193
|
+
- [AllergyIntolerance](./docs/resources/allergy-intolerance.md)
|
|
194
|
+
- [ClinicalImpression](./docs/resources/clinical-impression.md)
|
|
195
|
+
- [Composition](./docs/resources/composition.md)
|
|
109
196
|
- [Condition](./docs/resources/condition.md)
|
|
197
|
+
- [DICOM Router](./docs/resources/dicom-router.md)
|
|
198
|
+
- [QuestionnaireResponse](./docs/resources/questionnaire-response.md)
|
|
199
|
+
- [RiskAssessment](./docs/resources/risk-assessment.md)
|
|
110
200
|
- [DiagnosticReport](./docs/resources/diagnostic-report.md)
|
|
201
|
+
- [ImagingStudy](./docs/resources/imaging-study.md)
|
|
202
|
+
- [Encounter Builder](./docs/helpers/encounter-builder.md)
|
|
111
203
|
- [Patient](./docs/resources/patient.md)
|
|
112
204
|
- [Encounter](./docs/resources/encounter.md)
|
|
113
205
|
- [Procedure](./docs/resources/procedure.md)
|
|
114
206
|
- [Observation](./docs/resources/observation.md)
|
|
207
|
+
- [MedicationAdministration](./docs/resources/medication-administration.md)
|
|
208
|
+
- [NutritionOrder](./docs/resources/nutrition-order.md)
|
|
115
209
|
- [Medication](./docs/resources/medication.md)
|
|
116
210
|
- [MedicationRequest](./docs/resources/medication-request.md)
|
|
117
211
|
- [ServiceRequest](./docs/resources/service-request.md)
|
|
118
212
|
- [Specimen](./docs/resources/specimen.md)
|
|
119
213
|
- [ServiceRequest -> Specimen -> Observation Builder](./docs/helpers/service-request-specimen-observation-builder.md)
|
|
214
|
+
- [ServiceRequest -> ImagingStudy -> DiagnosticReport Builder](./docs/helpers/service-request-imaging-study-diagnostic-report-builder.md)
|
|
215
|
+
- [Chest X-Ray Study Builder](./docs/helpers/chest-xray-study-builder.md)
|
|
120
216
|
- [Laboratory Panel Builder](./docs/helpers/laboratory-panel-builder.md)
|
|
121
217
|
- [CBC Panel Builder](./docs/helpers/cbc-panel-builder.md)
|
|
218
|
+
- [Risk Assessment Builder](./docs/helpers/risk-assessment-builder.md)
|
|
122
219
|
- [Organization](./docs/resources/organization.md)
|
|
123
220
|
- [Location](./docs/resources/location.md)
|
|
124
221
|
- [Practitioner](./docs/resources/practitioner.md)
|
|
125
222
|
- [PractitionerRole](./docs/resources/practitioner-role.md)
|
|
126
223
|
- [Planning](./docs/planning.md)
|
|
127
224
|
|
|
225
|
+
## DICOM Router
|
|
226
|
+
|
|
227
|
+
SDK ini juga mendukung download file `docker-compose.yml` untuk DICOM Router SATUSEHAT:
|
|
228
|
+
|
|
229
|
+
```ts
|
|
230
|
+
const dockerCompose = await client.dicomRouter.downloadConfig();
|
|
231
|
+
```
|
|
232
|
+
|
|
233
|
+
Secara default SDK akan memakai endpoint berikut:
|
|
234
|
+
|
|
235
|
+
- sandbox: `https://api-satusehat-stg.dto.kemkes.go.id/dicom-router`
|
|
236
|
+
- production: `https://api-satusehat.kemkes.go.id/dicom-router`
|
|
237
|
+
|
|
238
|
+
## Buy Us a Coffee
|
|
239
|
+
|
|
240
|
+
Kalau project ini membantu, kamu bisa dukung Digital Medika lewat Saweria:
|
|
241
|
+
|
|
242
|
+
- [Buy us a coffee on Saweria](https://saweria.co/digitalmedika)
|
|
243
|
+
|
|
128
244
|
## Premium Support
|
|
129
245
|
|
|
130
246
|
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,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;
|