-
Notifications
You must be signed in to change notification settings - Fork 210
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
4 changed files
with
123 additions
and
76 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,39 @@ | ||
export interface OpenmrsResource { | ||
import { type User } from './user-resource'; | ||
|
||
export interface OpenmrsResource extends OpenmrsResourceStrict { | ||
[anythingElse: string]: any; | ||
} | ||
|
||
/** | ||
* Superclass for all Openmrs Resources, with strict typings. | ||
* If the subclass does not have all attributes (including optional ones) | ||
* accounted for, use OpenmrsResource instead. | ||
*/ | ||
export interface OpenmrsResourceStrict { | ||
uuid: string; | ||
display?: string; | ||
[anythingElse: string]: any; | ||
links?: Array<Link>; | ||
auditInfo?: AuditInfo; | ||
resourceVersion?: string; | ||
} | ||
|
||
export interface Link { | ||
rel: string; | ||
uri: string; | ||
resourceAlias?: string; | ||
} | ||
|
||
export interface AuditInfo { | ||
dateCreated?: string; | ||
creator?: User; | ||
dateChanged?: string; | ||
changedBy?: User; | ||
voided?: boolean; | ||
dateVoided?: string; | ||
voidedBy?: User; | ||
voidReason?: string; | ||
retired?: boolean; | ||
datedRetired?: string; | ||
retiredBy?: User; | ||
retireReason?: string; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,20 +1,28 @@ | ||
import { type OpenmrsResource } from './openmrs-resource'; | ||
import { type OpenmrsResourceStrict } from './openmrs-resource'; | ||
import { type Person } from './person-resource'; | ||
|
||
export interface PatientIdentifierType extends OpenmrsResource {} | ||
export interface PatientIdentifierType extends OpenmrsResourceStrict { | ||
name?: string; | ||
description?: string; | ||
format?: string; | ||
formatDescription?: string; | ||
required?: boolean; | ||
validator?: string; | ||
locationBehavior?: string; | ||
uniquenessBehavior?: string; | ||
retired?: boolean; | ||
} | ||
|
||
export interface Patient { | ||
uuid: string; | ||
display: string; | ||
identifiers: PatientIdentifier[]; | ||
person: Person; | ||
export interface Patient extends OpenmrsResourceStrict { | ||
identifiers?: PatientIdentifier[]; | ||
person?: Person; | ||
voided?: boolean; | ||
} | ||
|
||
export interface PatientIdentifier { | ||
uuid: string; | ||
display: string; | ||
identifier: string; | ||
identifierType: PatientIdentifierType; | ||
location: Location; | ||
preferred: boolean; | ||
export interface PatientIdentifier extends OpenmrsResourceStrict { | ||
identifier?: string; | ||
identifierType?: PatientIdentifierType; | ||
location?: Location; | ||
preferred?: boolean; | ||
voided?: boolean; | ||
} |
120 changes: 60 additions & 60 deletions
120
packages/framework/esm-api/src/types/person-resource.ts
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,69 +1,69 @@ | ||
import { type Concept } from './concept-resource'; | ||
import { type OpenmrsResource } from './openmrs-resource'; | ||
import { type OpenmrsResourceStrict, type OpenmrsResource } from './openmrs-resource'; | ||
|
||
export interface PersonAttribute { | ||
attributeType: OpenmrsResource; | ||
display: string; | ||
uuid: string; | ||
value: string | number; | ||
export interface PersonAttribute extends OpenmrsResourceStrict { | ||
attributeType?: OpenmrsResource; | ||
value?: string; | ||
voided?: boolean; | ||
} | ||
|
||
export interface Person { | ||
uuid: string; | ||
display: string; | ||
gender: string; | ||
age: number; | ||
birthdate: string; | ||
birthdateEstimated: boolean; | ||
dead: boolean; | ||
deathDate: string; | ||
causeOfDeath: Concept; | ||
preferredName: PersonName; | ||
preferredAddress: PersonAddress; | ||
names: Array<PersonName>; | ||
addresses: Array<PersonAddress>; | ||
attributes: Array<PersonAttribute>; | ||
birthtime: string; | ||
deathdateEstimated: boolean; | ||
causeOfDeathNonCoded: string; | ||
links: Array<any>; | ||
export interface Person extends OpenmrsResourceStrict { | ||
gender?: string; | ||
age?: number; | ||
birthdate?: string; | ||
birthdateEstimated?: boolean; | ||
dead?: boolean; | ||
deathDate?: string | null; | ||
causeOfDeath?: Concept | null; | ||
preferredName?: PersonName; | ||
preferredAddress?: PersonAddress; | ||
names?: Array<PersonName>; | ||
addresses?: Array<PersonAddress>; | ||
attributes?: Array<PersonAttribute>; | ||
voided?: boolean; | ||
birthtime?: string | null; | ||
deathdateEstimated?: boolean; | ||
causeOfDeathNonCoded?: string | null; | ||
} | ||
|
||
export interface PersonName { | ||
uuid: string; | ||
display: string; | ||
givenName: string; | ||
middleName: string; | ||
familyName: string; | ||
familyName2: string; | ||
export interface PersonName extends OpenmrsResourceStrict { | ||
givenName?: string; | ||
middleName?: string; | ||
familyName?: string; | ||
familyName2?: string; | ||
preferred?: boolean; | ||
prefix?: string; | ||
familyNamePrefix?: string; | ||
familyNameSuffix?: string; | ||
degree?: string; | ||
voided?: boolean; | ||
} | ||
|
||
export interface PersonAddress { | ||
uuid: string; | ||
display: string; | ||
preferred: true; | ||
cityVillage: string; | ||
stateProvince: string; | ||
country: string; | ||
postalCode: string; | ||
countyDistrict: string; | ||
startDate: string; | ||
endDate: string; | ||
latitude: string; | ||
longitude: string; | ||
address1: string; | ||
address2: string; | ||
address3: string; | ||
address4: string; | ||
address5: string; | ||
address6: string; | ||
address7: string; | ||
address8: string; | ||
address9: string; | ||
address10: string; | ||
address11: string; | ||
address12: string; | ||
address13: string; | ||
address14: string; | ||
address15: string; | ||
export interface PersonAddress extends OpenmrsResourceStrict { | ||
preferred?: boolean; | ||
cityVillage?: string; | ||
stateProvince?: string; | ||
country?: string; | ||
postalCode?: string; | ||
countyDistrict?: string; | ||
startDate?: string; | ||
endDate?: string; | ||
latitude?: string; | ||
longitude?: string; | ||
address1?: string; | ||
address2?: string; | ||
address3?: string; | ||
address4?: string; | ||
address5?: string; | ||
address6?: string; | ||
address7?: string; | ||
address8?: string; | ||
address9?: string; | ||
address10?: string; | ||
address11?: string; | ||
address12?: string; | ||
address13?: string; | ||
address14?: string; | ||
address15?: string; | ||
voided?: boolean; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters