@smile-cdr/fhirts 2.0.4 → 2.0.6

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/CHANGELOG.md CHANGED
@@ -1,5 +1,21 @@
1
1
  # Changelog
2
2
 
3
+ ## 2.0.6
4
+
5
+ ### Updates (R3)
6
+
7
+ * `DocumentReference.docStatus` and `DocumentReference.status` properties have codes defined.
8
+
9
+ ### Updates (R4)
10
+
11
+ * `DocumentReference.docStatus` has codes defined and `DocumentReference.status` is a required property (as per the spec).
12
+
13
+ ## 2.0.5
14
+
15
+ ### Updates (R3)
16
+
17
+ * `Encounter` class now has all properties defined.
18
+
3
19
  ## 2.0.4
4
20
 
5
21
  ### Updates (R4)
package/GETTINGSTARTED.md CHANGED
@@ -83,7 +83,7 @@ function getResourceType(resource:Resource){
83
83
  }
84
84
  }
85
85
  ```
86
- If you try writing this out you will see that the variable `res` inside the `if` block is of type `CarePlan`. This was inferred automatically using the `if` condition (since as per the specification the only resources which can have `resourceType:"CarePlan"` are `CarePlan` resources).
86
+ If you try writing this out you will see that the variable `resource` inside the `if` block is of type `CarePlan`. This was inferred automatically using the `if` condition (since as per the specification the only resources which can have `resourceType:"CarePlan"` are `CarePlan` resources).
87
87
 
88
88
  ## Utilities
89
89
 
package/dist/FHIR-R3.d.ts CHANGED
@@ -551,8 +551,8 @@ export declare class DocumentReference extends BaseResource {
551
551
  resourceType: "DocumentReference";
552
552
  masterIdentifier: Identifier;
553
553
  identifier: Identifier[];
554
- status: string;
555
- docStatus: string;
554
+ status: 'current' | 'superseded' | 'entered-in-error';
555
+ docStatus: 'preliminary' | 'final' | 'amended' | 'entered-in-error';
556
556
  type: CodeableConcept;
557
557
  subject: Reference;
558
558
  created: Date;
@@ -659,10 +659,50 @@ export declare class ProcessRequest extends BaseResource {
659
659
  export declare class Encounter extends BaseResource {
660
660
  resourceType: "Encounter";
661
661
  identifier: Identifier[];
662
- status: string;
662
+ status: 'planned' | 'arrived' | 'triaged' | 'in-progress' | 'onleave' | 'finished' | 'cancelled' | 'entered-in-error' | 'unknown';
663
+ statusHistory: {
664
+ status: 'planned' | 'arrived' | 'triaged' | 'in-progress' | 'onleave' | 'finished' | 'cancelled' | 'entered-in-error' | 'unknown';
665
+ period: Period;
666
+ }[];
667
+ class: Coding;
668
+ classHistory: {
669
+ class: Coding;
670
+ period: Period;
671
+ }[];
672
+ type: CodeableConcept[];
673
+ priority: CodeableConcept;
663
674
  episodeOfCare: Reference[];
664
675
  subject: Reference;
676
+ incomingReferral: Reference[];
665
677
  participant: EncounterParticipant[];
678
+ appointment: Reference;
679
+ period: Period;
680
+ length: Quantity;
681
+ reason: CodeableConcept[];
682
+ diagnosis: {
683
+ condition: Reference;
684
+ role: CodeableConcept;
685
+ rank: number;
686
+ }[];
687
+ account: Reference[];
688
+ hospitalization: {
689
+ preAdmissionIdentifer: Identifier;
690
+ origin: Reference;
691
+ admitSource: CodeableConcept;
692
+ reAdmission: CodeableConcept;
693
+ dietPreference: CodeableConcept[];
694
+ specialCourtesy: CodeableConcept[];
695
+ specialArrangement: CodeableConcept[];
696
+ destination: Reference;
697
+ dischargeDiposition: CodeableConcept;
698
+ };
699
+ location: {
700
+ location: Reference;
701
+ status: 'planned' | 'active' | 'reserved' | 'completed';
702
+ period: Period;
703
+ }[];
704
+ serviceProvider: Reference;
705
+ partOf: Reference;
666
706
  }
667
707
  export declare class CareTeamParticipant extends BackboneElement {
668
708
  role: CodeableConcept;
@@ -68,11 +68,11 @@ export declare class DocumentReference {
68
68
  /**
69
69
  * The status of this document reference.
70
70
  */
71
- status?: DocumentReference.StatusEnum;
71
+ status: DocumentReference.StatusEnum;
72
72
  /**
73
73
  * The status of the underlying document.
74
74
  */
75
- docStatus?: Code;
75
+ docStatus?: DocumentReference.DocStatusEnum;
76
76
  /**
77
77
  * Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.
78
78
  */
@@ -129,4 +129,11 @@ export declare namespace DocumentReference {
129
129
  Superseded: StatusEnum;
130
130
  EnteredInError: StatusEnum;
131
131
  };
132
+ type DocStatusEnum = 'preliminary' | 'final' | 'amended' | 'entered-in-error';
133
+ const DocStatusEnum: {
134
+ Preliminary: DocStatusEnum;
135
+ Final: DocStatusEnum;
136
+ Amended: DocStatusEnum;
137
+ EnteredInError: DocStatusEnum;
138
+ };
132
139
  }
@@ -13,4 +13,10 @@ exports.DocumentReference = DocumentReference;
13
13
  Superseded: 'superseded',
14
14
  EnteredInError: 'entered-in-error'
15
15
  };
16
+ DocumentReference.DocStatusEnum = {
17
+ Preliminary: 'preliminary',
18
+ Final: 'final',
19
+ Amended: 'amended',
20
+ EnteredInError: 'entered-in-error'
21
+ };
16
22
  })(DocumentReference = exports.DocumentReference || (exports.DocumentReference = {}));
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@smile-cdr/fhirts",
3
- "version": "2.0.4",
3
+ "version": "2.0.6",
4
4
  "description": "Fhir ts/js library for frontend apps",
5
5
  "license": "Apache-2.0",
6
6
  "main": "dist/index.js",
package/src/FHIR-R3.ts CHANGED
@@ -696,8 +696,8 @@ export class DocumentReference extends BaseResource {
696
696
  resourceType: "DocumentReference";
697
697
  masterIdentifier: Identifier;
698
698
  identifier: Identifier[];
699
- status: string;
700
- docStatus: string;
699
+ status: 'current' | 'superseded' | 'entered-in-error';
700
+ docStatus: 'preliminary' | 'final' | 'amended' | 'entered-in-error';
701
701
  type: CodeableConcept;
702
702
  subject: Reference;
703
703
  created: Date;
@@ -813,10 +813,50 @@ export class ProcessRequest extends BaseResource {
813
813
  export class Encounter extends BaseResource {
814
814
  resourceType: "Encounter";
815
815
  identifier: Identifier[];
816
- status: string;
816
+ status: 'planned' | 'arrived' | 'triaged' | 'in-progress' | 'onleave' | 'finished' | 'cancelled' | 'entered-in-error' | 'unknown';
817
+ statusHistory: {
818
+ status:'planned' | 'arrived' | 'triaged' | 'in-progress' | 'onleave' | 'finished' | 'cancelled' | 'entered-in-error' | 'unknown';
819
+ period: Period;
820
+ }[];
821
+ class:Coding;
822
+ classHistory:{
823
+ class:Coding;
824
+ period:Period;
825
+ }[];
826
+ type:CodeableConcept[];
827
+ priority:CodeableConcept;
817
828
  episodeOfCare: Reference[];
818
829
  subject: Reference;
830
+ incomingReferral:Reference[];
819
831
  participant: EncounterParticipant[];
832
+ appointment:Reference;
833
+ period:Period;
834
+ length:Quantity;
835
+ reason:CodeableConcept[];
836
+ diagnosis:{
837
+ condition:Reference;
838
+ role:CodeableConcept;
839
+ rank:number
840
+ }[];
841
+ account:Reference[];
842
+ hospitalization:{
843
+ preAdmissionIdentifer:Identifier;
844
+ origin:Reference;
845
+ admitSource:CodeableConcept;
846
+ reAdmission:CodeableConcept;
847
+ dietPreference:CodeableConcept[];
848
+ specialCourtesy:CodeableConcept[];
849
+ specialArrangement:CodeableConcept[];
850
+ destination:Reference;
851
+ dischargeDiposition:CodeableConcept;
852
+ };
853
+ location:{
854
+ location:Reference;
855
+ status: 'planned' | 'active' | 'reserved' | 'completed';
856
+ period: Period
857
+ }[];
858
+ serviceProvider:Reference;
859
+ partOf:Reference;
820
860
  }
821
861
 
822
862
  export class CareTeamParticipant extends BackboneElement {
@@ -71,11 +71,11 @@ export class DocumentReference {
71
71
  /**
72
72
  * The status of this document reference.
73
73
  */
74
- status?: DocumentReference.StatusEnum;
74
+ status: DocumentReference.StatusEnum;
75
75
  /**
76
76
  * The status of the underlying document.
77
77
  */
78
- docStatus?: Code;
78
+ docStatus?: DocumentReference.DocStatusEnum;
79
79
  /**
80
80
  * Specifies the particular kind of document referenced (e.g. History and Physical, Discharge Summary, Progress Note). This usually equates to the purpose of making the document referenced.
81
81
  */
@@ -132,4 +132,11 @@ export namespace DocumentReference {
132
132
  Superseded: 'superseded' as StatusEnum,
133
133
  EnteredInError: 'entered-in-error' as StatusEnum
134
134
  };
135
+ export type DocStatusEnum = 'preliminary' | 'final' | 'amended' | 'entered-in-error';
136
+ export const DocStatusEnum = {
137
+ Preliminary: 'preliminary' as DocStatusEnum,
138
+ Final: 'final' as DocStatusEnum,
139
+ Amended: 'amended' as DocStatusEnum,
140
+ EnteredInError: 'entered-in-error' as DocStatusEnum
141
+ };
135
142
  }