diff --git a/CHANGELOG.md b/CHANGELOG.md index da952962..8f1f8735 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -5,6 +5,7 @@ Changelog ## x.x - Change initializers: provide convenience initializers; initializers taking JSON may throw +- Generate enums for many closed ValueSets - Much better model validation diff --git a/README.md b/README.md index 2189cc42..1d6fd1ee 100644 --- a/README.md +++ b/README.md @@ -60,6 +60,7 @@ Working, at least to some extent: - Classes generated for FHIR's base resources + Use Swift native types whenever possible + Use custom Date/Time/DateTime/Instant structs + + Generate enums for many closed ValueSets - Create elements and resources programmatically - Use a FHIR server protocol for REST interactions with a server - Deserialize from JSON diff --git a/Sources/Client/FHIROpenServer.swift b/Sources/Client/FHIROpenServer.swift index 99b2cfd6..30d08774 100644 --- a/Sources/Client/FHIROpenServer.swift +++ b/Sources/Client/FHIROpenServer.swift @@ -184,7 +184,7 @@ open class FHIROpenServer: FHIRServer { if nil == best { best = rest } - else if "client" == rest.mode { + else if .client == rest.mode { best = rest break } diff --git a/Sources/Client/FHIROperation.swift b/Sources/Client/FHIROperation.swift index a8157414..85862ebb 100644 --- a/Sources/Client/FHIROperation.swift +++ b/Sources/Client/FHIROperation.swift @@ -113,7 +113,7 @@ open class FHIROperation: CustomStringConvertible { continue } - if "in" == param.use { + if .in == param.use { // have the parameter, validate it if nil != inParams?[param.name!] { diff --git a/Sources/Client/FHIRServerDataResponse.swift b/Sources/Client/FHIRServerDataResponse.swift index f6a540d2..f4d4a50a 100644 --- a/Sources/Client/FHIRServerDataResponse.swift +++ b/Sources/Client/FHIRServerDataResponse.swift @@ -211,7 +211,7 @@ open class FHIRServerJSONResponse: FHIRServerDataResponse { // inspect OperationOutcome if there was an error if status >= 400 { if let erritem = self.outcome?.issue?.first { - let errstr = "[\(erritem.severity ?? "unknown")] \(erritem.diagnostics ?? "unknown")" + let errstr = "[\(erritem.severity?.rawValue ?? "unknown")] \(erritem.diagnostics ?? "unknown")" self.error = FHIRError.requestError(status, errstr) } else if let errstr = json?["error"] as? String { diff --git a/Sources/Client/Patient+SMART.swift b/Sources/Client/Patient+SMART.swift index a042f7b1..71324133 100644 --- a/Sources/Client/Patient+SMART.swift +++ b/Sources/Client/Patient+SMART.swift @@ -21,10 +21,10 @@ extension Patient { } var useName: HumanName? for name in names { - if nil == useName || "usual" == name.use { + if nil == useName || .usual == name.use { useName = name } - else if let use = name.use, "usual" == use || "official" == use { + else if let use = name.use, .usual == use || .official == use { useName = name } } diff --git a/Sources/Models/Account.swift b/Sources/Models/Account.swift index 4e30d41f..796ed7c1 100644 --- a/Sources/Models/Account.swift +++ b/Sources/Models/Account.swift @@ -2,7 +2,7 @@ // Account.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Account) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Account) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Tracks balance, charges, for patient or cost center. - * - * A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track - * charges for a patient, cost centers, etc. - */ +Tracks balance, charges, for patient or cost center. + +A financial tool for tracking value accrued for a particular purpose. In the healthcare field, used to track charges +for a patient, cost centers, etc. +*/ open class Account: DomainResource { override open class var resourceType: String { get { return "Account" } @@ -47,8 +47,8 @@ open class Account: DomainResource { /// Who is responsible?. public var owner: Reference? - /// active | inactive | entered-in-error. - public var status: String? + /// Indicates whether the account is presently used/useable or not. + public var status: AccountStatus? /// What is account tied to?. public var subject: Reference? @@ -178,7 +178,12 @@ open class Account: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = AccountStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -246,7 +251,7 @@ open class Account: DomainResource { json["owner"] = owner.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) diff --git a/Sources/Models/ActivityDefinition.swift b/Sources/Models/ActivityDefinition.swift index 2d24b96c..6003a31c 100644 --- a/Sources/Models/ActivityDefinition.swift +++ b/Sources/Models/ActivityDefinition.swift @@ -2,7 +2,7 @@ // ActivityDefinition.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ActivityDefinition) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ActivityDefinition) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * The definition of a specific activity to be taken, independent of any particular patient or context. - * - * This resource allows for the definition of some activity to be performed, independent of a particular patient, - * practitioner, or other performance context. - */ +The definition of a specific activity to be taken, independent of any particular patient or context. + +This resource allows for the definition of some activity to be performed, independent of a particular patient, +practitioner, or other performance context. +*/ open class ActivityDefinition: DomainResource { override open class var resourceType: String { get { return "ActivityDefinition" } @@ -23,8 +23,8 @@ open class ActivityDefinition: DomainResource { /// When activity definition approved by publisher. public var approvalDate: FHIRDate? - /// communication | device | diagnostic | diet | drug | encounter | immunization | observation | procedure | referral | supply | vision | other. - public var category: String? + /// High-level categorization of the type of activity. + public var category: ActivityDefinitionCategory? /// Detail type of activity. public var code: CodeableConcept? @@ -74,8 +74,8 @@ open class ActivityDefinition: DomainResource { /// Name for this activity definition (Computer friendly). public var name: String? - /// patient | practitioner | related-person. - public var participantType: [String]? + /// The type of participant in the action. + public var participantType: [PlanActionParticipantType]? /// What's administered/supplied. public var productCodeableConcept: CodeableConcept? @@ -95,8 +95,8 @@ open class ActivityDefinition: DomainResource { /// Related artifacts for the asset. public var relatedArtifact: [RelatedArtifact]? - /// draft | active | retired. - public var status: String? + /// The status of this activity definition. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// When activity is to occur. public var timingCodeableConcept: CodeableConcept? @@ -127,7 +127,7 @@ open class ActivityDefinition: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: PublicationStatus) { self.init() self.status = status } @@ -147,7 +147,12 @@ open class ActivityDefinition: DomainResource { if let exist = json["category"] { presentKeys.insert("category") if let val = exist as? String { - self.category = val + if let enumval = ActivityDefinitionCategory(rawValue: val) { + self.category = enumval + } + else { + errors.append(FHIRValidationError(key: "category", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "category", wants: String.self, has: type(of: exist))) @@ -349,8 +354,12 @@ open class ActivityDefinition: DomainResource { } if let exist = json["participantType"] { presentKeys.insert("participantType") - if let val = exist as? [String] { - self.participantType = val + if let val = exist as? [String] { var i = -1 + self.participantType = val.map() { i += 1 + if let enumval = PlanActionParticipantType(rawValue: $0) { return enumval } + errors.append(FHIRValidationError(key: "participantType.\(i)", problem: "the value “\(val)” is not valid")) + return nil + }.filter() { nil != $0 }.map() { $0! } } else { errors.append(FHIRValidationError(key: "participantType", wants: Array.self, has: type(of: exist))) @@ -433,7 +442,12 @@ open class ActivityDefinition: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -558,7 +572,7 @@ open class ActivityDefinition: DomainResource { json["approvalDate"] = approvalDate.asJSON() } if let category = self.category { - json["category"] = category.asJSON() + json["category"] = category.rawValue } if let code = self.code { json["code"] = code.asJSON(errors: &errors) @@ -609,11 +623,7 @@ open class ActivityDefinition: DomainResource { json["name"] = name.asJSON() } if let participantType = self.participantType { - var arr = [Any]() - for val in participantType { - arr.append(val.asJSON()) - } - json["participantType"] = arr + json["participantType"] = participantType.map() { $0.rawValue } } if let productCodeableConcept = self.productCodeableConcept { json["productCodeableConcept"] = productCodeableConcept.asJSON(errors: &errors) @@ -634,7 +644,7 @@ open class ActivityDefinition: DomainResource { json["relatedArtifact"] = relatedArtifact.map() { $0.asJSON(errors: &errors) } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let timingCodeableConcept = self.timingCodeableConcept { json["timingCodeableConcept"] = timingCodeableConcept.asJSON(errors: &errors) @@ -670,12 +680,12 @@ open class ActivityDefinition: DomainResource { /** - * Dynamic aspects of the definition. - * - * Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the - * dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an - * expression that calculated the weight, and the path on the intent resource that would contain the result. - */ +Dynamic aspects of the definition. + +Dynamic values that will be evaluated to produce values for elements of the resulting resource. For example, if the +dosage of a medication must be computed based on the patient's weight, a dynamic value would be used to specify an +expression that calculated the weight, and the path on the intent resource that would contain the result. +*/ open class ActivityDefinitionDynamicValue: BackboneElement { override open class var resourceType: String { get { return "ActivityDefinitionDynamicValue" } diff --git a/Sources/Models/Address.swift b/Sources/Models/Address.swift index 53e90441..23ad46d7 100644 --- a/Sources/Models/Address.swift +++ b/Sources/Models/Address.swift @@ -2,7 +2,7 @@ // Address.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Address) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Address) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,12 +10,12 @@ import Foundation /** - * An address expressed using postal conventions (as opposed to GPS or other location definition formats). - * - * An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data - * type may be used to convey addresses for use in delivering mail as well as for visiting locations and which might - * not be valid for mail delivery. There are a variety of postal address formats defined around the world. - */ +An address expressed using postal conventions (as opposed to GPS or other location definition formats). + +An address expressed using postal conventions (as opposed to GPS or other location definition formats). This data type +may be used to convey addresses for use in delivering mail as well as for visiting locations and which might not be +valid for mail delivery. There are a variety of postal address formats defined around the world. +*/ open class Address: Element { override open class var resourceType: String { get { return "Address" } @@ -45,11 +45,12 @@ open class Address: Element { /// Text representation of the address. public var text: String? - /// postal | physical | both. - public var type: String? + /// Distinguishes between physical addresses (those you can visit) and mailing addresses (e.g. PO Boxes and care-of + /// addresses). Most addresses are both. + public var type: AddressType? - /// home | work | temp | old - purpose of this address. - public var use: String? + /// The purpose of this address. + public var use: AddressUse? override open func populate(from json: FHIRJSON, presentKeys: inout Set) throws -> [FHIRValidationError]? { @@ -134,7 +135,12 @@ open class Address: Element { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = AddressType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -143,7 +149,12 @@ open class Address: Element { if let exist = json["use"] { presentKeys.insert("use") if let val = exist as? String { - self.use = val + if let enumval = AddressUse(rawValue: val) { + self.use = enumval + } + else { + errors.append(FHIRValidationError(key: "use", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "use", wants: String.self, has: type(of: exist))) @@ -165,11 +176,7 @@ open class Address: Element { json["district"] = district.asJSON() } if let line = self.line { - var arr = [Any]() - for val in line { - arr.append(val.asJSON()) - } - json["line"] = arr + json["line"] = line.map() { $0.asJSON() } } if let period = self.period { json["period"] = period.asJSON(errors: &errors) @@ -184,10 +191,10 @@ open class Address: Element { json["text"] = text.asJSON() } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } if let use = self.use { - json["use"] = use.asJSON() + json["use"] = use.rawValue } return json diff --git a/Sources/Models/Age.swift b/Sources/Models/Age.swift index cc9562fb..3d42cead 100644 --- a/Sources/Models/Age.swift +++ b/Sources/Models/Age.swift @@ -2,7 +2,7 @@ // Age.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Age) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Age) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,8 +10,8 @@ import Foundation /** - * A duration of time during which an organism (or a process) has existed. - */ +A duration of time during which an organism (or a process) has existed. +*/ open class Age: Quantity { override open class var resourceType: String { get { return "Age" } diff --git a/Sources/Models/AllergyIntolerance.swift b/Sources/Models/AllergyIntolerance.swift index 207c3f05..dede943a 100644 --- a/Sources/Models/AllergyIntolerance.swift +++ b/Sources/Models/AllergyIntolerance.swift @@ -2,7 +2,7 @@ // AllergyIntolerance.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/AllergyIntolerance) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/AllergyIntolerance) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Allergy or Intolerance (generally: Risk of adverse reaction to a substance). - * - * Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure - * to a substance. - */ +Allergy or Intolerance (generally: Risk of adverse reaction to a substance). + +Risk of harmful or undesirable, physiological response which is unique to an individual and associated with exposure to +a substance. +*/ open class AllergyIntolerance: DomainResource { override open class var resourceType: String { get { return "AllergyIntolerance" } @@ -23,14 +23,14 @@ open class AllergyIntolerance: DomainResource { /// Date record was believed accurate. public var attestedDate: DateTime? - /// food | medication | biologic | environment. - public var category: [String]? + /// Category of the identified substance. + public var category: [AllergyIntoleranceCategory]? /// Allergy or intolerance code. public var code: CodeableConcept? - /// low | high | unable-to-assess. - public var criticality: String? + /// Estimate of the potential clinical harm, or seriousness, of the reaction to the identified substance. + public var criticality: AllergyIntoleranceCriticality? /// External ids for this item. public var identifier: [Identifier]? @@ -41,7 +41,7 @@ open class AllergyIntolerance: DomainResource { /// Additional text not captured in other fields. public var note: [Annotation]? - /// Date(/time) when manifestations showed. + /// Date(/time) when allergy or intolerance was identified. public var onset: DateTime? /// Who the sensitivity is for. @@ -56,11 +56,12 @@ open class AllergyIntolerance: DomainResource { /// Source of the information about the allergy. public var reporter: Reference? - /// active | active-confirmed | inactive | resolved | refuted | entered-in-error. - public var status: String? + /// Assertion about certainty associated with the propensity, or potential risk, of a reaction to the identified + /// substance (including pharmaceutical product). + public var status: AllergyIntoleranceStatus? - /// allergy | intolerance - Underlying mechanism (if known). - public var type: String? + /// Identification of the underlying physiological mechanism for the reaction risk. + public var type: AllergyIntoleranceType? /** Convenience initializer, taking all required properties as arguments. */ @@ -83,8 +84,12 @@ open class AllergyIntolerance: DomainResource { } if let exist = json["category"] { presentKeys.insert("category") - if let val = exist as? [String] { - self.category = val + if let val = exist as? [String] { var i = -1 + self.category = val.map() { i += 1 + if let enumval = AllergyIntoleranceCategory(rawValue: $0) { return enumval } + errors.append(FHIRValidationError(key: "category.\(i)", problem: "the value “\(val)” is not valid")) + return nil + }.filter() { nil != $0 }.map() { $0! } } else { errors.append(FHIRValidationError(key: "category", wants: Array.self, has: type(of: exist))) @@ -107,7 +112,12 @@ open class AllergyIntolerance: DomainResource { if let exist = json["criticality"] { presentKeys.insert("criticality") if let val = exist as? String { - self.criticality = val + if let enumval = AllergyIntoleranceCriticality(rawValue: val) { + self.criticality = enumval + } + else { + errors.append(FHIRValidationError(key: "criticality", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "criticality", wants: String.self, has: type(of: exist))) @@ -221,7 +231,12 @@ open class AllergyIntolerance: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = AllergyIntoleranceStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -230,7 +245,12 @@ open class AllergyIntolerance: DomainResource { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = AllergyIntoleranceType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -246,17 +266,13 @@ open class AllergyIntolerance: DomainResource { json["attestedDate"] = attestedDate.asJSON() } if let category = self.category { - var arr = [Any]() - for val in category { - arr.append(val.asJSON()) - } - json["category"] = arr + json["category"] = category.map() { $0.rawValue } } if let code = self.code { json["code"] = code.asJSON(errors: &errors) } if let criticality = self.criticality { - json["criticality"] = criticality.asJSON() + json["criticality"] = criticality.rawValue } if let identifier = self.identifier { json["identifier"] = identifier.map() { $0.asJSON(errors: &errors) } @@ -283,10 +299,10 @@ open class AllergyIntolerance: DomainResource { json["reporter"] = reporter.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json @@ -295,17 +311,18 @@ open class AllergyIntolerance: DomainResource { /** - * Adverse Reaction Events linked to exposure to substance. - * - * Details about each adverse reaction event linked to exposure to the identified substance. - */ +Adverse Reaction Events linked to exposure to substance. + +Details about each adverse reaction event linked to exposure to the identified substance. +*/ open class AllergyIntoleranceReaction: BackboneElement { override open class var resourceType: String { get { return "AllergyIntoleranceReaction" } } - /// unlikely | likely | confirmed | unknown. - public var certainty: String? + /// Statement about the degree of clinical certainty that the specific substance was the cause of the manifestation + /// in this reaction event. + public var certainty: AllergyIntoleranceCertainty? /// Description of the event as a whole. public var description_fhir: String? @@ -322,8 +339,9 @@ open class AllergyIntoleranceReaction: BackboneElement { /// Date(/time) when manifestations showed. public var onset: DateTime? - /// mild | moderate | severe (of event as a whole). - public var severity: String? + /// Clinical assessment of the severity of the reaction event as a whole, potentially considering multiple different + /// manifestations. + public var severity: AllergyIntoleranceSeverity? /// Specific substance or pharmaceutical product considered to be responsible for event. public var substance: CodeableConcept? @@ -341,7 +359,12 @@ open class AllergyIntoleranceReaction: BackboneElement { if let exist = json["certainty"] { presentKeys.insert("certainty") if let val = exist as? String { - self.certainty = val + if let enumval = AllergyIntoleranceCertainty(rawValue: val) { + self.certainty = enumval + } + else { + errors.append(FHIRValidationError(key: "certainty", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "certainty", wants: String.self, has: type(of: exist))) @@ -413,7 +436,12 @@ open class AllergyIntoleranceReaction: BackboneElement { if let exist = json["severity"] { presentKeys.insert("severity") if let val = exist as? String { - self.severity = val + if let enumval = AllergyIntoleranceSeverity(rawValue: val) { + self.severity = enumval + } + else { + errors.append(FHIRValidationError(key: "severity", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "severity", wants: String.self, has: type(of: exist))) @@ -440,7 +468,7 @@ open class AllergyIntoleranceReaction: BackboneElement { var json = super.asJSON(errors: &errors) if let certainty = self.certainty { - json["certainty"] = certainty.asJSON() + json["certainty"] = certainty.rawValue } if let description_fhir = self.description_fhir { json["description"] = description_fhir.asJSON() @@ -458,7 +486,7 @@ open class AllergyIntoleranceReaction: BackboneElement { json["onset"] = onset.asJSON() } if let severity = self.severity { - json["severity"] = severity.asJSON() + json["severity"] = severity.rawValue } if let substance = self.substance { json["substance"] = substance.asJSON(errors: &errors) diff --git a/Sources/Models/Annotation.swift b/Sources/Models/Annotation.swift index b8f79f15..eae18076 100644 --- a/Sources/Models/Annotation.swift +++ b/Sources/Models/Annotation.swift @@ -2,7 +2,7 @@ // Annotation.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Annotation) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Annotation) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Text node with attribution. - * - * A text note which also contains information about who made the statement and when. - */ +Text node with attribution. + +A text note which also contains information about who made the statement and when. +*/ open class Annotation: Element { override open class var resourceType: String { get { return "Annotation" } diff --git a/Sources/Models/Appointment.swift b/Sources/Models/Appointment.swift index f04c0abf..7904b483 100644 --- a/Sources/Models/Appointment.swift +++ b/Sources/Models/Appointment.swift @@ -2,7 +2,7 @@ // Appointment.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Appointment) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Appointment) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,9 +10,9 @@ import Foundation /** - * A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific - * date/time. This may result in one or more Encounter(s). - */ +A booking of a healthcare event among patient(s), practitioner(s), related person(s) and/or device(s) for a specific +date/time. This may result in one or more Encounter(s). +*/ open class Appointment: DomainResource { override open class var resourceType: String { get { return "Appointment" } @@ -66,12 +66,13 @@ open class Appointment: DomainResource { /// When appointment is to take place. public var start: Instant? - /// proposed | pending | booked | arrived | fulfilled | cancelled | noshow | entered-in-error. - public var status: String? + /// The overall status of the Appointment. Each of the participants has their own participation status which + /// indicates their involvement in the process, however this status indicates the shared status. + public var status: AppointmentStatus? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(participant: [AppointmentParticipant], status: String) { + public convenience init(participant: [AppointmentParticipant], status: AppointmentStatus) { self.init() self.participant = participant self.status = status @@ -275,7 +276,12 @@ open class Appointment: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = AppointmentStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -339,7 +345,7 @@ open class Appointment: DomainResource { json["start"] = start.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } return json @@ -348,10 +354,10 @@ open class Appointment: DomainResource { /** - * Participants involved in appointment. - * - * List of participants involved in the appointment. - */ +Participants involved in appointment. + +List of participants involved in the appointment. +*/ open class AppointmentParticipant: BackboneElement { override open class var resourceType: String { get { return "AppointmentParticipant" } @@ -360,18 +366,19 @@ open class AppointmentParticipant: BackboneElement { /// Person, Location/HealthcareService or Device. public var actor: Reference? - /// required | optional | information-only. - public var required: String? + /// Is this participant required to be present at the meeting. This covers a use-case where 2 doctors need to meet + /// to discuss the results for a specific patient, and the patient is not required to be present. + public var required: ParticipantRequired? - /// accepted | declined | tentative | needs-action. - public var status: String? + /// Participation status of the Patient. + public var status: ParticipationStatus? /// Role of participant in the appointment. public var type: [CodeableConcept]? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: ParticipationStatus) { self.init() self.status = status } @@ -396,7 +403,12 @@ open class AppointmentParticipant: BackboneElement { if let exist = json["required"] { presentKeys.insert("required") if let val = exist as? String { - self.required = val + if let enumval = ParticipantRequired(rawValue: val) { + self.required = enumval + } + else { + errors.append(FHIRValidationError(key: "required", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "required", wants: String.self, has: type(of: exist))) @@ -405,7 +417,12 @@ open class AppointmentParticipant: BackboneElement { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = ParticipationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -438,10 +455,10 @@ open class AppointmentParticipant: BackboneElement { json["actor"] = actor.asJSON(errors: &errors) } if let required = self.required { - json["required"] = required.asJSON() + json["required"] = required.rawValue } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let type = self.type { json["type"] = type.map() { $0.asJSON(errors: &errors) } diff --git a/Sources/Models/AppointmentResponse.swift b/Sources/Models/AppointmentResponse.swift index 13ff01d5..a35a5784 100644 --- a/Sources/Models/AppointmentResponse.swift +++ b/Sources/Models/AppointmentResponse.swift @@ -2,7 +2,7 @@ // AppointmentResponse.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/AppointmentResponse) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/AppointmentResponse) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,8 +10,8 @@ import Foundation /** - * A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. - */ +A reply to an appointment request for a patient and/or practitioner(s), such as a confirmation or rejection. +*/ open class AppointmentResponse: DomainResource { override open class var resourceType: String { get { return "AppointmentResponse" } @@ -32,8 +32,11 @@ open class AppointmentResponse: DomainResource { /// External Ids for this item. public var identifier: [Identifier]? - /// accepted | declined | tentative | in-process | completed | needs-action | entered-in-error. - public var participantStatus: String? + /// Participation status of the participant. When the status is declined or tentative if the start/end times are + /// different to the appointment, then these times should be interpreted as a requested time change. When the status + /// is accepted, the times can either be the time of the appointment (as a confirmation of the time) or can be + /// empty. + public var participantStatus: ParticipationStatus? /// Role of participant in the appointment. public var participantType: [CodeableConcept]? @@ -43,7 +46,7 @@ open class AppointmentResponse: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(appointment: Reference, participantStatus: String) { + public convenience init(appointment: Reference, participantStatus: ParticipationStatus) { self.init() self.appointment = appointment self.participantStatus = participantStatus @@ -118,7 +121,12 @@ open class AppointmentResponse: DomainResource { if let exist = json["participantStatus"] { presentKeys.insert("participantStatus") if let val = exist as? String { - self.participantStatus = val + if let enumval = ParticipationStatus(rawValue: val) { + self.participantStatus = enumval + } + else { + errors.append(FHIRValidationError(key: "participantStatus", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "participantStatus", wants: String.self, has: type(of: exist))) @@ -172,7 +180,7 @@ open class AppointmentResponse: DomainResource { json["identifier"] = identifier.map() { $0.asJSON(errors: &errors) } } if let participantStatus = self.participantStatus { - json["participantStatus"] = participantStatus.asJSON() + json["participantStatus"] = participantStatus.rawValue } if let participantType = self.participantType { json["participantType"] = participantType.map() { $0.asJSON(errors: &errors) } diff --git a/Sources/Models/Attachment.swift b/Sources/Models/Attachment.swift index baecb794..113276fc 100644 --- a/Sources/Models/Attachment.swift +++ b/Sources/Models/Attachment.swift @@ -2,7 +2,7 @@ // Attachment.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Attachment) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Attachment) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Content in a format defined elsewhere. - * - * For referring to data content defined in other formats. - */ +Content in a format defined elsewhere. + +For referring to data content defined in other formats. +*/ open class Attachment: Element { override open class var resourceType: String { get { return "Attachment" } diff --git a/Sources/Models/AuditEvent.swift b/Sources/Models/AuditEvent.swift index 52881698..d3391862 100644 --- a/Sources/Models/AuditEvent.swift +++ b/Sources/Models/AuditEvent.swift @@ -2,7 +2,7 @@ // AuditEvent.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/AuditEvent) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/AuditEvent) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,18 +10,18 @@ import Foundation /** - * Event record kept for security purposes. - * - * A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion - * attempts and monitoring for inappropriate usage. - */ +Event record kept for security purposes. + +A record of an event made for purposes of maintaining a security log. Typical uses include detection of intrusion +attempts and monitoring for inappropriate usage. +*/ open class AuditEvent: DomainResource { override open class var resourceType: String { get { return "AuditEvent" } } - /// Type of action performed during the event. - public var action: String? + /// Indicator for type of action performed during the event that generated the audit. + public var action: AuditEventAction? /// Actor involved in the event. public var agent: [AuditEventAgent]? @@ -66,7 +66,12 @@ open class AuditEvent: DomainResource { if let exist = json["action"] { presentKeys.insert("action") if let val = exist as? String { - self.action = val + if let enumval = AuditEventAction(rawValue: val) { + self.action = enumval + } + else { + errors.append(FHIRValidationError(key: "action", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "action", wants: String.self, has: type(of: exist))) @@ -202,7 +207,7 @@ open class AuditEvent: DomainResource { var json = super.asJSON(errors: &errors) if let action = self.action { - json["action"] = action.asJSON() + json["action"] = action.rawValue } if let agent = self.agent { json["agent"] = agent.map() { $0.asJSON(errors: &errors) } @@ -238,10 +243,10 @@ open class AuditEvent: DomainResource { /** - * Actor involved in the event. - * - * An actor taking an active role in the event or activity that is logged. - */ +Actor involved in the event. + +An actor taking an active role in the event or activity that is logged. +*/ open class AuditEventAgent: BackboneElement { override open class var resourceType: String { get { return "AuditEventAgent" } @@ -449,11 +454,7 @@ open class AuditEventAgent: BackboneElement { json["network"] = network.asJSON(errors: &errors) } if let policy = self.policy { - var arr = [Any]() - for val in policy { - arr.append(val.asJSON()) - } - json["policy"] = arr + json["policy"] = policy.map() { $0.asJSON() } } if let purposeOfUse = self.purposeOfUse { json["purposeOfUse"] = purposeOfUse.map() { $0.asJSON(errors: &errors) } @@ -477,10 +478,10 @@ open class AuditEventAgent: BackboneElement { /** - * Logical network location for application activity. - * - * Logical network location for application activity, if the activity has a network location. - */ +Logical network location for application activity. + +Logical network location for application activity, if the activity has a network location. +*/ open class AuditEventAgentNetwork: BackboneElement { override open class var resourceType: String { get { return "AuditEventAgentNetwork" } @@ -532,10 +533,10 @@ open class AuditEventAgentNetwork: BackboneElement { /** - * Data or objects used. - * - * Specific instances of data or objects that have been accessed. - */ +Data or objects used. + +Specific instances of data or objects that have been accessed. +*/ open class AuditEventEntity: BackboneElement { override open class var resourceType: String { get { return "AuditEventEntity" } @@ -742,8 +743,8 @@ open class AuditEventEntity: BackboneElement { /** - * Additional Information about the entity. - */ +Additional Information about the entity. +*/ open class AuditEventEntityDetail: BackboneElement { override open class var resourceType: String { get { return "AuditEventEntityDetail" } @@ -809,10 +810,10 @@ open class AuditEventEntityDetail: BackboneElement { /** - * Audit Event Reporter. - * - * The system that is reporting the event. - */ +Audit Event Reporter. + +The system that is reporting the event. +*/ open class AuditEventSource: BackboneElement { override open class var resourceType: String { get { return "AuditEventSource" } diff --git a/Sources/Models/BackboneElement.swift b/Sources/Models/BackboneElement.swift index 7be96cb8..84deb511 100644 --- a/Sources/Models/BackboneElement.swift +++ b/Sources/Models/BackboneElement.swift @@ -2,7 +2,7 @@ // BackboneElement.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/BackboneElement) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/BackboneElement) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Base for elements defined inside a resource. - * - * Base definition for all elements that are defined inside a resource - but not those in a data type. - */ +Base for elements defined inside a resource. + +Base definition for all elements that are defined inside a resource - but not those in a data type. +*/ open class BackboneElement: Element { override open class var resourceType: String { get { return "BackboneElement" } diff --git a/Sources/Models/Basic.swift b/Sources/Models/Basic.swift index 765461d4..48d4ab5a 100644 --- a/Sources/Models/Basic.swift +++ b/Sources/Models/Basic.swift @@ -2,7 +2,7 @@ // Basic.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Basic) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Basic) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Resource for non-supported content. - * - * Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing - * resource, and custom resources not appropriate for inclusion in the FHIR specification. - */ +Resource for non-supported content. + +Basic is used for handling concepts not yet defined in FHIR, narrative-only resources that don't map to an existing +resource, and custom resources not appropriate for inclusion in the FHIR specification. +*/ open class Basic: DomainResource { override open class var resourceType: String { get { return "Basic" } diff --git a/Sources/Models/Binary.swift b/Sources/Models/Binary.swift index fd2b87d5..95a9b65d 100644 --- a/Sources/Models/Binary.swift +++ b/Sources/Models/Binary.swift @@ -2,7 +2,7 @@ // Binary.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Binary) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Binary) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Pure binary content defined by some other format than FHIR. - * - * A binary resource can contain any content, whether text, image, pdf, zip archive, etc. - */ +Pure binary content defined by some other format than FHIR. + +A binary resource can contain any content, whether text, image, pdf, zip archive, etc. +*/ open class Binary: Resource { override open class var resourceType: String { get { return "Binary" } diff --git a/Sources/Models/BodySite.swift b/Sources/Models/BodySite.swift index 671ff8ac..cef7eb84 100644 --- a/Sources/Models/BodySite.swift +++ b/Sources/Models/BodySite.swift @@ -2,7 +2,7 @@ // BodySite.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/BodySite) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/BodySite) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Specific and identified anatomical location. - * - * Record details about the anatomical location of a specimen or body part. This resource may be used when a coded - * concept does not provide the necessary detail needed for the use case. - */ +Specific and identified anatomical location. + +Record details about the anatomical location of a specimen or body part. This resource may be used when a coded concept +does not provide the necessary detail needed for the use case. +*/ open class BodySite: DomainResource { override open class var resourceType: String { get { return "BodySite" } diff --git a/Sources/Models/Bundle.swift b/Sources/Models/Bundle.swift index 73c357c0..00721afd 100644 --- a/Sources/Models/Bundle.swift +++ b/Sources/Models/Bundle.swift @@ -2,7 +2,7 @@ // Bundle.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Bundle) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Bundle) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Contains a collection of resources. - * - * A container for a collection of resources. - */ +Contains a collection of resources. + +A container for a collection of resources. +*/ open class Bundle: Resource { override open class var resourceType: String { get { return "Bundle" } @@ -31,12 +31,12 @@ open class Bundle: Resource { /// If search, the total number of matches. public var total: UInt? - /// document | message | transaction | transaction-response | batch | batch-response | history | searchset | collection. - public var type: String? + /// Indicates the purpose of this bundle- how it was intended to be used. + public var type: BundleType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(type: String) { + public convenience init(type: BundleType) { self.init() self.type = type } @@ -98,7 +98,12 @@ open class Bundle: Resource { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = BundleType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -126,7 +131,7 @@ open class Bundle: Resource { json["total"] = total.asJSON() } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json @@ -135,11 +140,11 @@ open class Bundle: Resource { /** - * Entry in the bundle - will have a resource, or information. - * - * An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and - * history only). - */ +Entry in the bundle - will have a resource, or information. + +An entry in a bundle resource - will either contain a resource, or information about a resource (transactions and +history only). +*/ open class BundleEntry: BackboneElement { override open class var resourceType: String { get { return "BundleEntry" } @@ -276,10 +281,10 @@ open class BundleEntry: BackboneElement { /** - * Transaction Related Information. - * - * Additional information about how this entry should be processed as part of a transaction. - */ +Transaction Related Information. + +Additional information about how this entry should be processed as part of a transaction. +*/ open class BundleEntryRequest: BackboneElement { override open class var resourceType: String { get { return "BundleEntryRequest" } @@ -297,15 +302,15 @@ open class BundleEntryRequest: BackboneElement { /// For managing cache currency. public var ifNoneMatch: String? - /// GET | POST | PUT | DELETE. - public var method: String? + /// The HTTP verb for this entry in either a change history, or a transaction/ transaction response. + public var method: HTTPVerb? /// URL for HTTP equivalent of this entry. public var url: URL? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(method: String, url: URL) { + public convenience init(method: HTTPVerb, url: URL) { self.init() self.method = method self.url = url @@ -353,7 +358,12 @@ open class BundleEntryRequest: BackboneElement { if let exist = json["method"] { presentKeys.insert("method") if let val = exist as? String { - self.method = val + if let enumval = HTTPVerb(rawValue: val) { + self.method = enumval + } + else { + errors.append(FHIRValidationError(key: "method", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "method", wants: String.self, has: type(of: exist))) @@ -393,7 +403,7 @@ open class BundleEntryRequest: BackboneElement { json["ifNoneMatch"] = ifNoneMatch.asJSON() } if let method = self.method { - json["method"] = method.asJSON() + json["method"] = method.rawValue } if let url = self.url { json["url"] = url.asJSON() @@ -405,10 +415,10 @@ open class BundleEntryRequest: BackboneElement { /** - * Transaction Related Information. - * - * Additional information about how this entry should be processed as part of a transaction. - */ +Transaction Related Information. + +Additional information about how this entry should be processed as part of a transaction. +*/ open class BundleEntryResponse: BackboneElement { override open class var resourceType: String { get { return "BundleEntryResponse" } @@ -520,17 +530,17 @@ open class BundleEntryResponse: BackboneElement { /** - * Search related information. - * - * Information about the search process that lead to the creation of this entry. - */ +Search related information. + +Information about the search process that lead to the creation of this entry. +*/ open class BundleEntrySearch: BackboneElement { override open class var resourceType: String { get { return "BundleEntrySearch" } } - /// match | include | outcome - why this is in the result set. - public var mode: String? + /// Why this entry is in the result set - whether it's included as a match or because of an _include requirement. + public var mode: SearchEntryMode? /// Search ranking (between 0 and 1). public var score: NSDecimalNumber? @@ -541,7 +551,12 @@ open class BundleEntrySearch: BackboneElement { if let exist = json["mode"] { presentKeys.insert("mode") if let val = exist as? String { - self.mode = val + if let enumval = SearchEntryMode(rawValue: val) { + self.mode = enumval + } + else { + errors.append(FHIRValidationError(key: "mode", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "mode", wants: String.self, has: type(of: exist))) @@ -563,7 +578,7 @@ open class BundleEntrySearch: BackboneElement { var json = super.asJSON(errors: &errors) if let mode = self.mode { - json["mode"] = mode.asJSON() + json["mode"] = mode.rawValue } if let score = self.score { json["score"] = score.asJSON() @@ -575,10 +590,10 @@ open class BundleEntrySearch: BackboneElement { /** - * Links related to this Bundle. - * - * A series of links that provide context to this bundle. - */ +Links related to this Bundle. + +A series of links that provide context to this bundle. +*/ open class BundleLink: BackboneElement { override open class var resourceType: String { get { return "BundleLink" } diff --git a/Sources/Models/CapabilityStatement.swift b/Sources/Models/CapabilityStatement.swift index cc73bf25..597beef8 100644 --- a/Sources/Models/CapabilityStatement.swift +++ b/Sources/Models/CapabilityStatement.swift @@ -2,7 +2,7 @@ // CapabilityStatement.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/CapabilityStatement) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/CapabilityStatement) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,18 +10,18 @@ import Foundation /** - * A statement of system Capabilities. - * - * A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement - * of actual server functionality or a statement of required or desired server implementation. - */ +A statement of system Capabilities. + +A Capability Statement documents a set of capabilities (behaviors) of a FHIR Server that may be used as a statement of +actual server functionality or a statement of required or desired server implementation. +*/ open class CapabilityStatement: DomainResource { override open class var resourceType: String { get { return "CapabilityStatement" } } - /// no | extensions | elements | both. - public var acceptUnknown: String? + /// A code that indicates whether the application accepts unknown elements or extensions when reading resources. + public var acceptUnknown: UnknownContentCode? /// Contact details for the publisher. public var contact: [ContactDetail]? @@ -56,8 +56,9 @@ open class CapabilityStatement: DomainResource { /// Intended jurisdiction for capability statement (if applicable). public var jurisdiction: [CodeableConcept]? - /// instance | capability | requirements. - public var kind: String? + /// The way that this statement is intended to be used, to describe an actual running instance of software, a + /// particular product (kind not instance of software) or a class of implementation (e.g. a desired purchase). + public var kind: CapabilityStatementKind? /// If messaging is supported. public var messaging: [CapabilityStatementMessaging]? @@ -80,8 +81,8 @@ open class CapabilityStatement: DomainResource { /// Software that is covered by this capability statement. public var software: CapabilityStatementSoftware? - /// draft | active | retired. - public var status: String? + /// The status of this capability statement. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Name for this capability statement (Human friendly). public var title: String? @@ -97,7 +98,7 @@ open class CapabilityStatement: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(acceptUnknown: String, date: DateTime, fhirVersion: String, format: [String], kind: String, status: String) { + public convenience init(acceptUnknown: UnknownContentCode, date: DateTime, fhirVersion: String, format: [String], kind: CapabilityStatementKind, status: PublicationStatus) { self.init() self.acceptUnknown = acceptUnknown self.date = date @@ -113,7 +114,12 @@ open class CapabilityStatement: DomainResource { if let exist = json["acceptUnknown"] { presentKeys.insert("acceptUnknown") if let val = exist as? String { - self.acceptUnknown = val + if let enumval = UnknownContentCode(rawValue: val) { + self.acceptUnknown = enumval + } + else { + errors.append(FHIRValidationError(key: "acceptUnknown", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "acceptUnknown", wants: String.self, has: type(of: exist))) @@ -253,7 +259,12 @@ open class CapabilityStatement: DomainResource { if let exist = json["kind"] { presentKeys.insert("kind") if let val = exist as? String { - self.kind = val + if let enumval = CapabilityStatementKind(rawValue: val) { + self.kind = enumval + } + else { + errors.append(FHIRValidationError(key: "kind", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "kind", wants: String.self, has: type(of: exist))) @@ -348,7 +359,12 @@ open class CapabilityStatement: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -405,7 +421,7 @@ open class CapabilityStatement: DomainResource { var json = super.asJSON(errors: &errors) if let acceptUnknown = self.acceptUnknown { - json["acceptUnknown"] = acceptUnknown.asJSON() + json["acceptUnknown"] = acceptUnknown.rawValue } if let contact = self.contact { json["contact"] = contact.map() { $0.asJSON(errors: &errors) } @@ -429,27 +445,19 @@ open class CapabilityStatement: DomainResource { json["fhirVersion"] = fhirVersion.asJSON() } if let format = self.format { - var arr = [Any]() - for val in format { - arr.append(val.asJSON()) - } - json["format"] = arr + json["format"] = format.map() { $0.asJSON() } } if let implementation = self.implementation { json["implementation"] = implementation.asJSON(errors: &errors) } if let instantiates = self.instantiates { - var arr = [Any]() - for val in instantiates { - arr.append(val.asJSON()) - } - json["instantiates"] = arr + json["instantiates"] = instantiates.map() { $0.asJSON() } } if let jurisdiction = self.jurisdiction { json["jurisdiction"] = jurisdiction.map() { $0.asJSON(errors: &errors) } } if let kind = self.kind { - json["kind"] = kind.asJSON() + json["kind"] = kind.rawValue } if let messaging = self.messaging { json["messaging"] = messaging.map() { $0.asJSON(errors: &errors) } @@ -473,7 +481,7 @@ open class CapabilityStatement: DomainResource { json["software"] = software.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let title = self.title { json["title"] = title.asJSON() @@ -494,10 +502,10 @@ open class CapabilityStatement: DomainResource { /** - * Document definition. - * - * A document definition. - */ +Document definition. + +A document definition. +*/ open class CapabilityStatementDocument: BackboneElement { override open class var resourceType: String { get { return "CapabilityStatementDocument" } @@ -506,15 +514,15 @@ open class CapabilityStatementDocument: BackboneElement { /// Description of document support. public var documentation: String? - /// producer | consumer. - public var mode: String? + /// Mode of this document declaration - whether application is producer or consumer. + public var mode: DocumentMode? /// Constraint on a resource used in the document. public var profile: Reference? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(mode: String, profile: Reference) { + public convenience init(mode: DocumentMode, profile: Reference) { self.init() self.mode = mode self.profile = profile @@ -535,7 +543,12 @@ open class CapabilityStatementDocument: BackboneElement { if let exist = json["mode"] { presentKeys.insert("mode") if let val = exist as? String { - self.mode = val + if let enumval = DocumentMode(rawValue: val) { + self.mode = enumval + } + else { + errors.append(FHIRValidationError(key: "mode", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "mode", wants: String.self, has: type(of: exist))) @@ -571,7 +584,7 @@ open class CapabilityStatementDocument: BackboneElement { json["documentation"] = documentation.asJSON() } if let mode = self.mode { - json["mode"] = mode.asJSON() + json["mode"] = mode.rawValue } if let profile = self.profile { json["profile"] = profile.asJSON(errors: &errors) @@ -583,11 +596,11 @@ open class CapabilityStatementDocument: BackboneElement { /** - * If this describes a specific instance. - * - * Identifies a specific implementation instance that is described by the capability statement - i.e. a particular - * installation, rather than the capabilities of a software program. - */ +If this describes a specific instance. + +Identifies a specific implementation instance that is described by the capability statement - i.e. a particular +installation, rather than the capabilities of a software program. +*/ open class CapabilityStatementImplementation: BackboneElement { override open class var resourceType: String { get { return "CapabilityStatementImplementation" } @@ -649,10 +662,10 @@ open class CapabilityStatementImplementation: BackboneElement { /** - * If messaging is supported. - * - * A description of the messaging capabilities of the solution. - */ +If messaging is supported. + +A description of the messaging capabilities of the solution. +*/ open class CapabilityStatementMessaging: BackboneElement { override open class var resourceType: String { get { return "CapabilityStatementMessaging" } @@ -754,10 +767,10 @@ open class CapabilityStatementMessaging: BackboneElement { /** - * Where messages should be sent. - * - * An endpoint (network accessible address) to which messages and/or replies are to be sent. - */ +Where messages should be sent. + +An endpoint (network accessible address) to which messages and/or replies are to be sent. +*/ open class CapabilityStatementMessagingEndpoint: BackboneElement { override open class var resourceType: String { get { return "CapabilityStatementMessagingEndpoint" } @@ -828,17 +841,17 @@ open class CapabilityStatementMessagingEndpoint: BackboneElement { /** - * Declare support for this event. - * - * A description of the solution's support for an event at this end-point. - */ +Declare support for this event. + +A description of the solution's support for an event at this end-point. +*/ open class CapabilityStatementMessagingEvent: BackboneElement { override open class var resourceType: String { get { return "CapabilityStatementMessagingEvent" } } - /// Consequence | Currency | Notification. - public var category: String? + /// The impact of the content of the message. + public var category: MessageSignificanceCategory? /// Event type. public var code: Coding? @@ -849,8 +862,8 @@ open class CapabilityStatementMessagingEvent: BackboneElement { /// Resource that's focus of message. public var focus: String? - /// sender | receiver. - public var mode: String? + /// The mode of this event declaration - whether application is sender or receiver. + public var mode: EventCapabilityMode? /// Profile that describes the request. public var request: Reference? @@ -860,7 +873,7 @@ open class CapabilityStatementMessagingEvent: BackboneElement { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(code: Coding, focus: String, mode: String, request: Reference, response: Reference) { + public convenience init(code: Coding, focus: String, mode: EventCapabilityMode, request: Reference, response: Reference) { self.init() self.code = code self.focus = focus @@ -875,7 +888,12 @@ open class CapabilityStatementMessagingEvent: BackboneElement { if let exist = json["category"] { presentKeys.insert("category") if let val = exist as? String { - self.category = val + if let enumval = MessageSignificanceCategory(rawValue: val) { + self.category = enumval + } + else { + errors.append(FHIRValidationError(key: "category", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "category", wants: String.self, has: type(of: exist))) @@ -922,7 +940,12 @@ open class CapabilityStatementMessagingEvent: BackboneElement { if let exist = json["mode"] { presentKeys.insert("mode") if let val = exist as? String { - self.mode = val + if let enumval = EventCapabilityMode(rawValue: val) { + self.mode = enumval + } + else { + errors.append(FHIRValidationError(key: "mode", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "mode", wants: String.self, has: type(of: exist))) @@ -972,7 +995,7 @@ open class CapabilityStatementMessagingEvent: BackboneElement { var json = super.asJSON(errors: &errors) if let category = self.category { - json["category"] = category.asJSON() + json["category"] = category.rawValue } if let code = self.code { json["code"] = code.asJSON(errors: &errors) @@ -984,7 +1007,7 @@ open class CapabilityStatementMessagingEvent: BackboneElement { json["focus"] = focus.asJSON() } if let mode = self.mode { - json["mode"] = mode.asJSON() + json["mode"] = mode.rawValue } if let request = self.request { json["request"] = request.asJSON(errors: &errors) @@ -999,10 +1022,10 @@ open class CapabilityStatementMessagingEvent: BackboneElement { /** - * If the endpoint is a RESTful one. - * - * A definition of the restful capabilities of the solution, if any. - */ +If the endpoint is a RESTful one. + +A definition of the restful capabilities of the solution, if any. +*/ open class CapabilityStatementRest: BackboneElement { override open class var resourceType: String { get { return "CapabilityStatementRest" } @@ -1017,8 +1040,9 @@ open class CapabilityStatementRest: BackboneElement { /// What operations are supported?. public var interaction: [CapabilityStatementRestInteraction]? - /// client | server. - public var mode: String? + /// Identifies whether this portion of the statement is describing ability to initiate or receive restful + /// operations. + public var mode: RestfulCapabilityMode? /// Definition of an operation or a custom query. public var operation: [CapabilityStatementRestOperation]? @@ -1034,7 +1058,7 @@ open class CapabilityStatementRest: BackboneElement { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(mode: String) { + public convenience init(mode: RestfulCapabilityMode) { self.init() self.mode = mode } @@ -1077,7 +1101,12 @@ open class CapabilityStatementRest: BackboneElement { if let exist = json["mode"] { presentKeys.insert("mode") if let val = exist as? String { - self.mode = val + if let enumval = RestfulCapabilityMode(rawValue: val) { + self.mode = enumval + } + else { + errors.append(FHIRValidationError(key: "mode", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "mode", wants: String.self, has: type(of: exist))) @@ -1149,11 +1178,7 @@ open class CapabilityStatementRest: BackboneElement { var json = super.asJSON(errors: &errors) if let compartment = self.compartment { - var arr = [Any]() - for val in compartment { - arr.append(val.asJSON()) - } - json["compartment"] = arr + json["compartment"] = compartment.map() { $0.asJSON() } } if let documentation = self.documentation { json["documentation"] = documentation.asJSON() @@ -1162,7 +1187,7 @@ open class CapabilityStatementRest: BackboneElement { json["interaction"] = interaction.map() { $0.asJSON(errors: &errors) } } if let mode = self.mode { - json["mode"] = mode.asJSON() + json["mode"] = mode.rawValue } if let operation = self.operation { json["operation"] = operation.map() { $0.asJSON(errors: &errors) } @@ -1183,24 +1208,25 @@ open class CapabilityStatementRest: BackboneElement { /** - * What operations are supported?. - * - * A specification of restful operations supported by the system. - */ +What operations are supported?. + +A specification of restful operations supported by the system. +*/ open class CapabilityStatementRestInteraction: BackboneElement { override open class var resourceType: String { get { return "CapabilityStatementRestInteraction" } } - /// transaction | batch | search-system | history-system. - public var code: String? + /// A coded identifier of the operation, supported by the system. + /// Only use: ['transaction', 'batch', 'search-system', 'history-system'] + public var code: FHIRRestfulInteractions? /// Anything special about operation behavior. public var documentation: String? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(code: String) { + public convenience init(code: FHIRRestfulInteractions) { self.init() self.code = code } @@ -1211,7 +1237,12 @@ open class CapabilityStatementRestInteraction: BackboneElement { if let exist = json["code"] { presentKeys.insert("code") if let val = exist as? String { - self.code = val + if let enumval = FHIRRestfulInteractions(rawValue: val) { + self.code = enumval + } + else { + errors.append(FHIRValidationError(key: "code", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "code", wants: String.self, has: type(of: exist))) @@ -1236,7 +1267,7 @@ open class CapabilityStatementRestInteraction: BackboneElement { var json = super.asJSON(errors: &errors) if let code = self.code { - json["code"] = code.asJSON() + json["code"] = code.rawValue } if let documentation = self.documentation { json["documentation"] = documentation.asJSON() @@ -1248,10 +1279,10 @@ open class CapabilityStatementRestInteraction: BackboneElement { /** - * Definition of an operation or a custom query. - * - * Definition of an operation or a named query and with its parameters and their meaning and type. - */ +Definition of an operation or a custom query. + +Definition of an operation or a named query and with its parameters and their meaning and type. +*/ open class CapabilityStatementRestOperation: BackboneElement { override open class var resourceType: String { get { return "CapabilityStatementRestOperation" } @@ -1322,10 +1353,10 @@ open class CapabilityStatementRestOperation: BackboneElement { /** - * Resource served on the REST interface. - * - * A specification of the restful capabilities of the solution for a specific resource type. - */ +Resource served on the REST interface. + +A specification of the restful capabilities of the solution for a specific resource type. +*/ open class CapabilityStatementRestResource: BackboneElement { override open class var resourceType: String { get { return "CapabilityStatementRestResource" } @@ -1334,11 +1365,11 @@ open class CapabilityStatementRestResource: BackboneElement { /// If allows/uses conditional create. public var conditionalCreate: Bool? - /// not-supported | single | multiple - how conditional delete is supported. - public var conditionalDelete: String? + /// A code that indicates how the server supports conditional delete. + public var conditionalDelete: ConditionalDeleteStatus? - /// not-supported | modified-since | not-match | full-support. - public var conditionalRead: String? + /// A code that indicates how the server supports conditional read. + public var conditionalRead: ConditionalReadStatus? /// If allows/uses conditional update. public var conditionalUpdate: Bool? @@ -1355,8 +1386,8 @@ open class CapabilityStatementRestResource: BackboneElement { /// Whether vRead can return past versions. public var readHistory: Bool? - /// literal | logical | resolves | enforced | local. - public var referencePolicy: [String]? + /// A set of flags that defines how references are supported. + public var referencePolicy: [ReferenceHandlingPolicy]? /// _include values supported by the server. public var searchInclude: [String]? @@ -1373,8 +1404,11 @@ open class CapabilityStatementRestResource: BackboneElement { /// If update can commit to a new identity. public var updateCreate: Bool? - /// no-version | versioned | versioned-update. - public var versioning: String? + /// This field is set to no-version to specify that the system does not support (server) or use (client) versioning + /// for this resource type. If this has some other value, the server must at least correctly track and populate the + /// versionId meta-property on resources. If the value is 'versioned-update', then the server supports all the + /// versioning features, including using e-tags for version integrity in the API. + public var versioning: ResourceVersionPolicy? /** Convenience initializer, taking all required properties as arguments. */ @@ -1399,7 +1433,12 @@ open class CapabilityStatementRestResource: BackboneElement { if let exist = json["conditionalDelete"] { presentKeys.insert("conditionalDelete") if let val = exist as? String { - self.conditionalDelete = val + if let enumval = ConditionalDeleteStatus(rawValue: val) { + self.conditionalDelete = enumval + } + else { + errors.append(FHIRValidationError(key: "conditionalDelete", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "conditionalDelete", wants: String.self, has: type(of: exist))) @@ -1408,7 +1447,12 @@ open class CapabilityStatementRestResource: BackboneElement { if let exist = json["conditionalRead"] { presentKeys.insert("conditionalRead") if let val = exist as? String { - self.conditionalRead = val + if let enumval = ConditionalReadStatus(rawValue: val) { + self.conditionalRead = enumval + } + else { + errors.append(FHIRValidationError(key: "conditionalRead", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "conditionalRead", wants: String.self, has: type(of: exist))) @@ -1474,8 +1518,12 @@ open class CapabilityStatementRestResource: BackboneElement { } if let exist = json["referencePolicy"] { presentKeys.insert("referencePolicy") - if let val = exist as? [String] { - self.referencePolicy = val + if let val = exist as? [String] { var i = -1 + self.referencePolicy = val.map() { i += 1 + if let enumval = ReferenceHandlingPolicy(rawValue: $0) { return enumval } + errors.append(FHIRValidationError(key: "referencePolicy.\(i)", problem: "the value “\(val)” is not valid")) + return nil + }.filter() { nil != $0 }.map() { $0! } } else { errors.append(FHIRValidationError(key: "referencePolicy", wants: Array.self, has: type(of: exist))) @@ -1537,7 +1585,12 @@ open class CapabilityStatementRestResource: BackboneElement { if let exist = json["versioning"] { presentKeys.insert("versioning") if let val = exist as? String { - self.versioning = val + if let enumval = ResourceVersionPolicy(rawValue: val) { + self.versioning = enumval + } + else { + errors.append(FHIRValidationError(key: "versioning", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "versioning", wants: String.self, has: type(of: exist))) @@ -1553,10 +1606,10 @@ open class CapabilityStatementRestResource: BackboneElement { json["conditionalCreate"] = conditionalCreate.asJSON() } if let conditionalDelete = self.conditionalDelete { - json["conditionalDelete"] = conditionalDelete.asJSON() + json["conditionalDelete"] = conditionalDelete.rawValue } if let conditionalRead = self.conditionalRead { - json["conditionalRead"] = conditionalRead.asJSON() + json["conditionalRead"] = conditionalRead.rawValue } if let conditionalUpdate = self.conditionalUpdate { json["conditionalUpdate"] = conditionalUpdate.asJSON() @@ -1574,28 +1627,16 @@ open class CapabilityStatementRestResource: BackboneElement { json["readHistory"] = readHistory.asJSON() } if let referencePolicy = self.referencePolicy { - var arr = [Any]() - for val in referencePolicy { - arr.append(val.asJSON()) - } - json["referencePolicy"] = arr + json["referencePolicy"] = referencePolicy.map() { $0.rawValue } } if let searchInclude = self.searchInclude { - var arr = [Any]() - for val in searchInclude { - arr.append(val.asJSON()) - } - json["searchInclude"] = arr + json["searchInclude"] = searchInclude.map() { $0.asJSON() } } if let searchParam = self.searchParam { json["searchParam"] = searchParam.map() { $0.asJSON(errors: &errors) } } if let searchRevInclude = self.searchRevInclude { - var arr = [Any]() - for val in searchRevInclude { - arr.append(val.asJSON()) - } - json["searchRevInclude"] = arr + json["searchRevInclude"] = searchRevInclude.map() { $0.asJSON() } } if let type = self.type { json["type"] = type.asJSON() @@ -1604,7 +1645,7 @@ open class CapabilityStatementRestResource: BackboneElement { json["updateCreate"] = updateCreate.asJSON() } if let versioning = self.versioning { - json["versioning"] = versioning.asJSON() + json["versioning"] = versioning.rawValue } return json @@ -1613,24 +1654,25 @@ open class CapabilityStatementRestResource: BackboneElement { /** - * What operations are supported?. - * - * Identifies a restful operation supported by the solution. - */ +What operations are supported?. + +Identifies a restful operation supported by the solution. +*/ open class CapabilityStatementRestResourceInteraction: BackboneElement { override open class var resourceType: String { get { return "CapabilityStatementRestResourceInteraction" } } - /// read | vread | update | delete | history-instance | history-type | create | search-type. - public var code: String? + /// Coded identifier of the operation, supported by the system resource. + /// Only use: ['read', 'vread', 'update', 'delete', 'history-instance', 'history-type', 'create', 'search-type'] + public var code: FHIRRestfulInteractions? /// Anything special about operation behavior. public var documentation: String? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(code: String) { + public convenience init(code: FHIRRestfulInteractions) { self.init() self.code = code } @@ -1641,7 +1683,12 @@ open class CapabilityStatementRestResourceInteraction: BackboneElement { if let exist = json["code"] { presentKeys.insert("code") if let val = exist as? String { - self.code = val + if let enumval = FHIRRestfulInteractions(rawValue: val) { + self.code = enumval + } + else { + errors.append(FHIRValidationError(key: "code", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "code", wants: String.self, has: type(of: exist))) @@ -1666,7 +1713,7 @@ open class CapabilityStatementRestResourceInteraction: BackboneElement { var json = super.asJSON(errors: &errors) if let code = self.code { - json["code"] = code.asJSON() + json["code"] = code.rawValue } if let documentation = self.documentation { json["documentation"] = documentation.asJSON() @@ -1678,11 +1725,11 @@ open class CapabilityStatementRestResourceInteraction: BackboneElement { /** - * Search params supported by implementation. - * - * Search parameters for implementations to support and/or make use of - either references to ones defined in the - * specification, or additional ones defined for/by the implementation. - */ +Search params supported by implementation. + +Search parameters for implementations to support and/or make use of - either references to ones defined in the +specification, or additional ones defined for/by the implementation. +*/ open class CapabilityStatementRestResourceSearchParam: BackboneElement { override open class var resourceType: String { get { return "CapabilityStatementRestResourceSearchParam" } @@ -1697,8 +1744,8 @@ open class CapabilityStatementRestResourceSearchParam: BackboneElement { /// Server-specific usage. public var documentation: String? - /// missing | exact | contains | not | text | in | not-in | below | above | type. - public var modifier: [String]? + /// A modifier supported for the search parameter. + public var modifier: [SearchModifierCode]? /// Name of search parameter. public var name: String? @@ -1706,12 +1753,12 @@ open class CapabilityStatementRestResourceSearchParam: BackboneElement { /// Types of resource (if a resource reference). public var target: [String]? - /// number | date | string | token | reference | composite | quantity | uri. - public var type: String? + /// The type of value a search parameter refers to, and how the content is interpreted. + public var type: SearchParamType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(name: String, type: String) { + public convenience init(name: String, type: SearchParamType) { self.init() self.name = name self.type = type @@ -1749,8 +1796,12 @@ open class CapabilityStatementRestResourceSearchParam: BackboneElement { } if let exist = json["modifier"] { presentKeys.insert("modifier") - if let val = exist as? [String] { - self.modifier = val + if let val = exist as? [String] { var i = -1 + self.modifier = val.map() { i += 1 + if let enumval = SearchModifierCode(rawValue: $0) { return enumval } + errors.append(FHIRValidationError(key: "modifier.\(i)", problem: "the value “\(val)” is not valid")) + return nil + }.filter() { nil != $0 }.map() { $0! } } else { errors.append(FHIRValidationError(key: "modifier", wants: Array.self, has: type(of: exist))) @@ -1780,7 +1831,12 @@ open class CapabilityStatementRestResourceSearchParam: BackboneElement { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = SearchParamType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -1796,11 +1852,7 @@ open class CapabilityStatementRestResourceSearchParam: BackboneElement { var json = super.asJSON(errors: &errors) if let chain = self.chain { - var arr = [Any]() - for val in chain { - arr.append(val.asJSON()) - } - json["chain"] = arr + json["chain"] = chain.map() { $0.asJSON() } } if let definition = self.definition { json["definition"] = definition.asJSON() @@ -1809,24 +1861,16 @@ open class CapabilityStatementRestResourceSearchParam: BackboneElement { json["documentation"] = documentation.asJSON() } if let modifier = self.modifier { - var arr = [Any]() - for val in modifier { - arr.append(val.asJSON()) - } - json["modifier"] = arr + json["modifier"] = modifier.map() { $0.rawValue } } if let name = self.name { json["name"] = name.asJSON() } if let target = self.target { - var arr = [Any]() - for val in target { - arr.append(val.asJSON()) - } - json["target"] = arr + json["target"] = target.map() { $0.asJSON() } } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json @@ -1835,10 +1879,10 @@ open class CapabilityStatementRestResourceSearchParam: BackboneElement { /** - * Information about security of implementation. - * - * Information about security implementation from an interface perspective - what a client needs to know. - */ +Information about security of implementation. + +Information about security implementation from an interface perspective - what a client needs to know. +*/ open class CapabilityStatementRestSecurity: BackboneElement { override open class var resourceType: String { get { return "CapabilityStatementRestSecurity" } @@ -1930,8 +1974,8 @@ open class CapabilityStatementRestSecurity: BackboneElement { /** - * Certificates associated with security profiles. - */ +Certificates associated with security profiles. +*/ open class CapabilityStatementRestSecurityCertificate: BackboneElement { override open class var resourceType: String { get { return "CapabilityStatementRestSecurityCertificate" } @@ -1983,11 +2027,11 @@ open class CapabilityStatementRestSecurityCertificate: BackboneElement { /** - * Software that is covered by this capability statement. - * - * Software that is covered by this capability statement. It is used when the capability statement describes the - * capabilities of a particular software version, independent of an installation. - */ +Software that is covered by this capability statement. + +Software that is covered by this capability statement. It is used when the capability statement describes the +capabilities of a particular software version, independent of an installation. +*/ open class CapabilityStatementSoftware: BackboneElement { override open class var resourceType: String { get { return "CapabilityStatementSoftware" } diff --git a/Sources/Models/CarePlan.swift b/Sources/Models/CarePlan.swift index e2d3ef7b..cc68de02 100644 --- a/Sources/Models/CarePlan.swift +++ b/Sources/Models/CarePlan.swift @@ -2,7 +2,7 @@ // CarePlan.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/CarePlan) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/CarePlan) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Healthcare plan for patient or group. - * - * Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or - * community for a period of time, possibly limited to care for a specific condition or set of conditions. - */ +Healthcare plan for patient or group. + +Describes the intention of how one or more practitioners intend to deliver care for a particular patient, group or +community for a period of time, possibly limited to care for a specific condition or set of conditions. +*/ open class CarePlan: DomainResource { override open class var resourceType: String { get { return "CarePlan" } @@ -38,6 +38,9 @@ open class CarePlan: DomainResource { /// Created in context of. public var context: Reference? + /// Protocol or definition. + public var definition: Reference? + /// Summary of nature of plan. public var description_fhir: String? @@ -59,8 +62,9 @@ open class CarePlan: DomainResource { /// Plans related to this one. public var relatedPlan: [CarePlanRelatedPlan]? - /// proposed | draft | active | suspended | completed | entered-in-error | cancelled. - public var status: String? + /// Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical + /// record. + public var status: CarePlanStatus? /// Who care plan is for. public var subject: Reference? @@ -70,7 +74,7 @@ open class CarePlan: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: CarePlanStatus) { self.init() self.status = status } @@ -162,6 +166,20 @@ open class CarePlan: DomainResource { errors.append(FHIRValidationError(key: "context", wants: FHIRJSON.self, has: type(of: exist))) } } + if let exist = json["definition"] { + presentKeys.insert("definition") + if let val = exist as? FHIRJSON { + do { + self.definition = try Reference(json: val, owner: self) + } + catch let error as FHIRValidationError { + errors.append(error.prefixed(with: "definition")) + } + } + else { + errors.append(FHIRValidationError(key: "definition", wants: FHIRJSON.self, has: type(of: exist))) + } + } if let exist = json["description"] { presentKeys.insert("description") if let val = exist as? String { @@ -253,7 +271,12 @@ open class CarePlan: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = CarePlanStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -314,6 +337,9 @@ open class CarePlan: DomainResource { if let context = self.context { json["context"] = context.asJSON(errors: &errors) } + if let definition = self.definition { + json["definition"] = definition.asJSON(errors: &errors) + } if let description_fhir = self.description_fhir { json["description"] = description_fhir.asJSON() } @@ -336,7 +362,7 @@ open class CarePlan: DomainResource { json["relatedPlan"] = relatedPlan.map() { $0.asJSON(errors: &errors) } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) @@ -351,11 +377,11 @@ open class CarePlan: DomainResource { /** - * Action to occur as part of plan. - * - * Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to - * perform, self-monitoring, education, etc. - */ +Action to occur as part of plan. + +Identifies a planned action to occur as part of the plan. For example, a medication to be used, lab tests to perform, +self-monitoring, education, etc. +*/ open class CarePlanActivity: BackboneElement { override open class var resourceType: String { get { return "CarePlanActivity" } @@ -477,11 +503,11 @@ open class CarePlanActivity: BackboneElement { /** - * In-line definition of activity. - * - * A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know - * about specific resources such as procedure etc. - */ +In-line definition of activity. + +A simple summary of a planned activity suitable for a general care plan system (e.g. form driven) that doesn't know +about specific resources such as procedure etc. +*/ open class CarePlanActivityDetail: BackboneElement { override open class var resourceType: String { get { return "CarePlanActivityDetail" } @@ -538,13 +564,20 @@ open class CarePlanActivityDetail: BackboneElement { /// When activity is to occur. public var scheduledTiming: Timing? - /// not-started | scheduled | in-progress | on-hold | completed | cancelled. - public var status: String? + /// Identifies what progress is being made for the specific activity. + public var status: CarePlanActivityStatus? /// Reason for current status. public var statusReason: CodeableConcept? + /** Convenience initializer, taking all required properties as arguments. */ + public convenience init(status: CarePlanActivityStatus) { + self.init() + self.status = status + } + + override open func populate(from json: FHIRJSON, presentKeys: inout Set) throws -> [FHIRValidationError]? { var errors = try super.populate(from: json, presentKeys: &presentKeys) ?? [FHIRValidationError]() if let exist = json["category"] { @@ -773,12 +806,20 @@ open class CarePlanActivityDetail: BackboneElement { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = CarePlanActivityStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) } } + else { + errors.append(FHIRValidationError(missing: "status")) + } if let exist = json["statusReason"] { presentKeys.insert("statusReason") if let val = exist as? FHIRJSON { @@ -851,7 +892,7 @@ open class CarePlanActivityDetail: BackboneElement { json["scheduledTiming"] = scheduledTiming.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let statusReason = self.statusReason { json["statusReason"] = statusReason.asJSON(errors: &errors) @@ -863,17 +904,17 @@ open class CarePlanActivityDetail: BackboneElement { /** - * Plans related to this one. - * - * Identifies CarePlans with some sort of formal relationship to the current plan. - */ +Plans related to this one. + +Identifies CarePlans with some sort of formal relationship to the current plan. +*/ open class CarePlanRelatedPlan: BackboneElement { override open class var resourceType: String { get { return "CarePlanRelatedPlan" } } - /// includes | replaces | fulfills. - public var code: String? + /// Identifies the type of relationship this plan has to the target plan. + public var code: CarePlanRelationship? /// Plan relationship exists with. public var plan: Reference? @@ -891,7 +932,12 @@ open class CarePlanRelatedPlan: BackboneElement { if let exist = json["code"] { presentKeys.insert("code") if let val = exist as? String { - self.code = val + if let enumval = CarePlanRelationship(rawValue: val) { + self.code = enumval + } + else { + errors.append(FHIRValidationError(key: "code", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "code", wants: String.self, has: type(of: exist))) @@ -921,7 +967,7 @@ open class CarePlanRelatedPlan: BackboneElement { var json = super.asJSON(errors: &errors) if let code = self.code { - json["code"] = code.asJSON() + json["code"] = code.rawValue } if let plan = self.plan { json["plan"] = plan.asJSON(errors: &errors) diff --git a/Sources/Models/CareTeam.swift b/Sources/Models/CareTeam.swift index 8120148d..65848881 100644 --- a/Sources/Models/CareTeam.swift +++ b/Sources/Models/CareTeam.swift @@ -2,7 +2,7 @@ // CareTeam.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/CareTeam) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/CareTeam) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,21 +10,24 @@ import Foundation /** - * Planned participants in the coordination and delivery of care for a patient or group. - * - * The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of - * care for a patient. - */ +Planned participants in the coordination and delivery of care for a patient or group. + +The Care Team includes all the people and organizations who plan to participate in the coordination and delivery of care +for a patient. +*/ open class CareTeam: DomainResource { override open class var resourceType: String { get { return "CareTeam" } } + /// Type of team. + public var category: [CodeableConcept]? + /// External Ids for this team. public var identifier: [Identifier]? /// Organization responsible for the care team. - public var managingOrganization: Reference? + public var managingOrganization: [Reference]? /// Name of the team, such as crisis assessment team. public var name: String? @@ -41,12 +44,23 @@ open class CareTeam: DomainResource { /// Who care team is for. public var subject: Reference? - /// Type of team. - public var type: [CodeableConcept]? - override open func populate(from json: FHIRJSON, presentKeys: inout Set) throws -> [FHIRValidationError]? { var errors = try super.populate(from: json, presentKeys: &presentKeys) ?? [FHIRValidationError]() + if let exist = json["category"] { + presentKeys.insert("category") + if let val = exist as? [FHIRJSON] { + do { + self.category = try CodeableConcept.instantiate(fromArray: val, owner: self) as? [CodeableConcept] + } + catch let error as FHIRValidationError { + errors.append(error.prefixed(with: "category")) + } + } + else { + errors.append(FHIRValidationError(key: "category", wants: Array.self, has: type(of: exist))) + } + } if let exist = json["identifier"] { presentKeys.insert("identifier") if let val = exist as? [FHIRJSON] { @@ -63,16 +77,16 @@ open class CareTeam: DomainResource { } if let exist = json["managingOrganization"] { presentKeys.insert("managingOrganization") - if let val = exist as? FHIRJSON { + if let val = exist as? [FHIRJSON] { do { - self.managingOrganization = try Reference(json: val, owner: self) + self.managingOrganization = try Reference.instantiate(fromArray: val, owner: self) as? [Reference] } catch let error as FHIRValidationError { errors.append(error.prefixed(with: "managingOrganization")) } } else { - errors.append(FHIRValidationError(key: "managingOrganization", wants: FHIRJSON.self, has: type(of: exist))) + errors.append(FHIRValidationError(key: "managingOrganization", wants: Array.self, has: type(of: exist))) } } if let exist = json["name"] { @@ -140,31 +154,20 @@ open class CareTeam: DomainResource { errors.append(FHIRValidationError(key: "subject", wants: FHIRJSON.self, has: type(of: exist))) } } - if let exist = json["type"] { - presentKeys.insert("type") - if let val = exist as? [FHIRJSON] { - do { - self.type = try CodeableConcept.instantiate(fromArray: val, owner: self) as? [CodeableConcept] - } - catch let error as FHIRValidationError { - errors.append(error.prefixed(with: "type")) - } - } - else { - errors.append(FHIRValidationError(key: "type", wants: Array.self, has: type(of: exist))) - } - } return errors.isEmpty ? nil : errors } override open func asJSON(errors: inout [FHIRValidationError]) -> FHIRJSON { var json = super.asJSON(errors: &errors) + if let category = self.category { + json["category"] = category.map() { $0.asJSON(errors: &errors) } + } if let identifier = self.identifier { json["identifier"] = identifier.map() { $0.asJSON(errors: &errors) } } if let managingOrganization = self.managingOrganization { - json["managingOrganization"] = managingOrganization.asJSON(errors: &errors) + json["managingOrganization"] = managingOrganization.map() { $0.asJSON(errors: &errors) } } if let name = self.name { json["name"] = name.asJSON() @@ -181,9 +184,6 @@ open class CareTeam: DomainResource { if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) } - if let type = self.type { - json["type"] = type.map() { $0.asJSON(errors: &errors) } - } return json } @@ -191,10 +191,10 @@ open class CareTeam: DomainResource { /** - * Members of the team. - * - * Identifies all people and organizations who are expected to be involved in the care team. - */ +Members of the team. + +Identifies all people and organizations who are expected to be involved in the care team. +*/ open class CareTeamParticipant: BackboneElement { override open class var resourceType: String { get { return "CareTeamParticipant" } diff --git a/Sources/Models/Claim.swift b/Sources/Models/Claim.swift index 0886aaf3..ed0daf68 100644 --- a/Sources/Models/Claim.swift +++ b/Sources/Models/Claim.swift @@ -2,7 +2,7 @@ // Claim.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Claim) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Claim) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Claim, Pre-determination or Pre-authorization. - * - * A provider issued list of services and products provided, or to be provided, to a patient which is provided to an - * insurer for payment recovery. - */ +Claim, Pre-determination or Pre-authorization. + +A provider issued list of services and products provided, or to be provided, to a patient which is provided to an +insurer for payment recovery. +*/ open class Claim: DomainResource { override open class var resourceType: String { get { return "Claim" } @@ -101,8 +101,8 @@ open class Claim: DomainResource { /// Current specification followed. public var ruleset: Coding? - /// active | cancelled | draft | entered-in-error. - public var status: String? + /// The status of the resource instance. + public var status: ClaimStatus? /// Finer grained claim type information. public var subType: [Coding]? @@ -113,12 +113,12 @@ open class Claim: DomainResource { /// Type or discipline. public var type: Coding? - /// complete | proposed | exploratory | other. - public var use: String? + /// Complete (Bill or Claim), Proposed (Pre-Authorization), Exploratory (Pre-determination). + public var use: Use? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(patient: Reference, status: String, type: Coding) { + public convenience init(patient: Reference, status: ClaimStatus, type: Coding) { self.init() self.patient = patient self.status = status @@ -507,7 +507,12 @@ open class Claim: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = ClaimStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -564,7 +569,12 @@ open class Claim: DomainResource { if let exist = json["use"] { presentKeys.insert("use") if let val = exist as? String { - self.use = val + if let enumval = Use(rawValue: val) { + self.use = enumval + } + else { + errors.append(FHIRValidationError(key: "use", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "use", wants: String.self, has: type(of: exist))) @@ -658,7 +668,7 @@ open class Claim: DomainResource { json["ruleset"] = ruleset.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subType = self.subType { json["subType"] = subType.map() { $0.asJSON(errors: &errors) } @@ -670,7 +680,7 @@ open class Claim: DomainResource { json["type"] = type.asJSON(errors: &errors) } if let use = self.use { - json["use"] = use.asJSON() + json["use"] = use.rawValue } return json @@ -679,16 +689,18 @@ open class Claim: DomainResource { /** - * Details about an accident. - * - * An accident which resulted in the need for healthcare services. - */ +Details about an accident. + +An accident which resulted in the need for healthcare services. +*/ open class ClaimAccident: BackboneElement { override open class var resourceType: String { get { return "ClaimAccident" } } - /// When the accident occurred see information codes see information codes. + /// When the accident occurred + /// see information codes + /// see information codes. public var date: FHIRDate? /// Accident Place. @@ -789,10 +801,10 @@ open class ClaimAccident: BackboneElement { /** - * Insurance or medical plan. - * - * Financial instrument by which payment information for health care. - */ +Insurance or medical plan. + +Financial instrument by which payment information for health care. +*/ open class ClaimCoverage: BackboneElement { override open class var resourceType: String { get { return "ClaimCoverage" } @@ -940,11 +952,7 @@ open class ClaimCoverage: BackboneElement { json["originalRuleset"] = originalRuleset.asJSON(errors: &errors) } if let preAuthRef = self.preAuthRef { - var arr = [Any]() - for val in preAuthRef { - arr.append(val.asJSON()) - } - json["preAuthRef"] = arr + json["preAuthRef"] = preAuthRef.map() { $0.asJSON() } } if let sequence = self.sequence { json["sequence"] = sequence.asJSON() @@ -956,10 +964,10 @@ open class ClaimCoverage: BackboneElement { /** - * Diagnosis. - * - * Ordered list of patient diagnosis for which care is sought. - */ +Diagnosis. + +Ordered list of patient diagnosis for which care is sought. +*/ open class ClaimDiagnosis: BackboneElement { override open class var resourceType: String { get { return "ClaimDiagnosis" } @@ -1070,11 +1078,11 @@ open class ClaimDiagnosis: BackboneElement { /** - * Exceptions, special considerations, the condition, situation, prior or concurrent issues. - * - * Additional information codes regarding exceptions, special considerations, the condition, situation, prior or - * concurrent issues. Often there are mutiple jurisdiction specific valuesets which are required. - */ +Exceptions, special considerations, the condition, situation, prior or concurrent issues. + +Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent +issues. Often there are mutiple jurisdiction specific valuesets which are required. +*/ open class ClaimInformation: BackboneElement { override open class var resourceType: String { get { return "ClaimInformation" } @@ -1216,10 +1224,10 @@ open class ClaimInformation: BackboneElement { /** - * Goods and Services. - * - * First tier of goods and services. - */ +Goods and Services. + +First tier of goods and services. +*/ open class ClaimItem: BackboneElement { override open class var resourceType: String { get { return "ClaimItem" } @@ -1623,11 +1631,7 @@ open class ClaimItem: BackboneElement { json["detail"] = detail.map() { $0.asJSON(errors: &errors) } } if let diagnosisLinkId = self.diagnosisLinkId { - var arr = [Any]() - for val in diagnosisLinkId { - arr.append(val.asJSON()) - } - json["diagnosisLinkId"] = arr + json["diagnosisLinkId"] = diagnosisLinkId.map() { $0.asJSON() } } if let factor = self.factor { json["factor"] = factor.asJSON() @@ -1690,11 +1694,11 @@ open class ClaimItem: BackboneElement { /** - * Members of the care team. - * - * The members of the team who provided the overall service as well as their role and whether responsible and - * qualifications. - */ +Members of the care team. + +The members of the team who provided the overall service as well as their role and whether responsible and +qualifications. +*/ open class ClaimItemCareTeam: BackboneElement { override open class var resourceType: String { get { return "ClaimItemCareTeam" } @@ -1801,10 +1805,10 @@ open class ClaimItemCareTeam: BackboneElement { /** - * Additional items. - * - * Second tier of goods and services. - */ +Additional items. + +Second tier of goods and services. +*/ open class ClaimItemDetail: BackboneElement { override open class var resourceType: String { get { return "ClaimItemDetail" } @@ -2081,10 +2085,10 @@ open class ClaimItemDetail: BackboneElement { /** - * Additional items. - * - * Third tier of goods and services. - */ +Additional items. + +Third tier of goods and services. +*/ open class ClaimItemDetailSubDetail: BackboneElement { override open class var resourceType: String { get { return "ClaimItemDetailSubDetail" } @@ -2341,10 +2345,10 @@ open class ClaimItemDetailSubDetail: BackboneElement { /** - * Prosthetic details. - * - * The materials and placement date of prior fixed prosthesis. - */ +Prosthetic details. + +The materials and placement date of prior fixed prosthesis. +*/ open class ClaimItemProsthesis: BackboneElement { override open class var resourceType: String { get { return "ClaimItemProsthesis" } @@ -2416,11 +2420,10 @@ open class ClaimItemProsthesis: BackboneElement { /** - * Only if type = oral. - * - * A list of teeth which would be expected but are not found due to having been previously extracted or for other - * reasons. - */ +Only if type = oral. + +A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons. +*/ open class ClaimMissingTeeth: BackboneElement { override open class var resourceType: String { get { return "ClaimMissingTeeth" } @@ -2507,10 +2510,10 @@ open class ClaimMissingTeeth: BackboneElement { /** - * Party to be paid any benefits payable. - * - * The party to be reimbursed for the services. - */ +Party to be paid any benefits payable. + +The party to be reimbursed for the services. +*/ open class ClaimPayee: BackboneElement { override open class var resourceType: String { get { return "ClaimPayee" } @@ -2602,10 +2605,10 @@ open class ClaimPayee: BackboneElement { /** - * Procedures performed. - * - * Ordered list of patient procedures performed to support the adjudication. - */ +Procedures performed. + +Ordered list of patient procedures performed to support the adjudication. +*/ open class ClaimProcedure: BackboneElement { override open class var resourceType: String { get { return "ClaimProcedure" } @@ -2721,10 +2724,10 @@ open class ClaimProcedure: BackboneElement { /** - * Related Claims which may be revelant to processing this claimn. - * - * Other claims which are related to this claim such as prior claim versions or for related services. - */ +Related Claims which may be revelant to processing this claimn. + +Other claims which are related to this claim such as prior claim versions or for related services. +*/ open class ClaimRelated: BackboneElement { override open class var resourceType: String { get { return "ClaimRelated" } diff --git a/Sources/Models/ClaimResponse.swift b/Sources/Models/ClaimResponse.swift index 1f228207..caaff21d 100644 --- a/Sources/Models/ClaimResponse.swift +++ b/Sources/Models/ClaimResponse.swift @@ -2,7 +2,7 @@ // ClaimResponse.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ClaimResponse) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ClaimResponse) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Remittance resource. - * - * This resource provides the adjudication details from the processing of a Claim resource. - */ +Remittance resource. + +This resource provides the adjudication details from the processing of a Claim resource. +*/ open class ClaimResponse: DomainResource { override open class var resourceType: String { get { return "ClaimResponse" } @@ -76,8 +76,8 @@ open class ClaimResponse: DomainResource { /// Resource version. public var ruleset: Coding? - /// active | cancelled | draft | entered-in-error. - public var status: String? + /// The status of the resource instance. + public var status: ClaimResponseStatus? /// Total benefit payable for the Claim. public var totalBenefit: Money? @@ -90,7 +90,7 @@ open class ClaimResponse: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: ClaimResponseStatus) { self.init() self.status = status } @@ -357,7 +357,12 @@ open class ClaimResponse: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = ClaimResponseStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -472,7 +477,7 @@ open class ClaimResponse: DomainResource { json["ruleset"] = ruleset.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let totalBenefit = self.totalBenefit { json["totalBenefit"] = totalBenefit.asJSON(errors: &errors) @@ -490,10 +495,10 @@ open class ClaimResponse: DomainResource { /** - * Insurer added line items. - * - * The first tier service adjudications for payor added services. - */ +Insurer added line items. + +The first tier service adjudications for payor added services. +*/ open class ClaimResponseAddItem: BackboneElement { override open class var resourceType: String { get { return "ClaimResponseAddItem" } @@ -667,21 +672,13 @@ open class ClaimResponseAddItem: BackboneElement { json["modifier"] = modifier.map() { $0.asJSON(errors: &errors) } } if let noteNumber = self.noteNumber { - var arr = [Any]() - for val in noteNumber { - arr.append(val.asJSON()) - } - json["noteNumber"] = arr + json["noteNumber"] = noteNumber.map() { $0.asJSON() } } if let revenue = self.revenue { json["revenue"] = revenue.asJSON(errors: &errors) } if let sequenceLinkId = self.sequenceLinkId { - var arr = [Any]() - for val in sequenceLinkId { - arr.append(val.asJSON()) - } - json["sequenceLinkId"] = arr + json["sequenceLinkId"] = sequenceLinkId.map() { $0.asJSON() } } if let service = self.service { json["service"] = service.asJSON(errors: &errors) @@ -693,10 +690,10 @@ open class ClaimResponseAddItem: BackboneElement { /** - * Added items details. - * - * The second tier service adjudications for payor added services. - */ +Added items details. + +The second tier service adjudications for payor added services. +*/ open class ClaimResponseAddItemDetail: BackboneElement { override open class var resourceType: String { get { return "ClaimResponseAddItemDetail" } @@ -838,11 +835,7 @@ open class ClaimResponseAddItemDetail: BackboneElement { json["modifier"] = modifier.map() { $0.asJSON(errors: &errors) } } if let noteNumber = self.noteNumber { - var arr = [Any]() - for val in noteNumber { - arr.append(val.asJSON()) - } - json["noteNumber"] = arr + json["noteNumber"] = noteNumber.map() { $0.asJSON() } } if let revenue = self.revenue { json["revenue"] = revenue.asJSON(errors: &errors) @@ -857,10 +850,10 @@ open class ClaimResponseAddItemDetail: BackboneElement { /** - * Insurance or medical plan. - * - * Financial instrument by which payment information for health care. - */ +Insurance or medical plan. + +Financial instrument by which payment information for health care. +*/ open class ClaimResponseCoverage: BackboneElement { override open class var resourceType: String { get { return "ClaimResponseCoverage" } @@ -988,11 +981,7 @@ open class ClaimResponseCoverage: BackboneElement { json["focal"] = focal.asJSON() } if let preAuthRef = self.preAuthRef { - var arr = [Any]() - for val in preAuthRef { - arr.append(val.asJSON()) - } - json["preAuthRef"] = arr + json["preAuthRef"] = preAuthRef.map() { $0.asJSON() } } if let sequence = self.sequence { json["sequence"] = sequence.asJSON() @@ -1004,10 +993,10 @@ open class ClaimResponseCoverage: BackboneElement { /** - * Processing errors. - * - * Mutually exclusive with Services Provided (Item). - */ +Processing errors. + +Mutually exclusive with Services Provided (Item). +*/ open class ClaimResponseError: BackboneElement { override open class var resourceType: String { get { return "ClaimResponseError" } @@ -1104,10 +1093,10 @@ open class ClaimResponseError: BackboneElement { /** - * Line items. - * - * The first tier service adjudications for submitted services. - */ +Line items. + +The first tier service adjudications for submitted services. +*/ open class ClaimResponseItem: BackboneElement { override open class var resourceType: String { get { return "ClaimResponseItem" } @@ -1197,11 +1186,7 @@ open class ClaimResponseItem: BackboneElement { json["detail"] = detail.map() { $0.asJSON(errors: &errors) } } if let noteNumber = self.noteNumber { - var arr = [Any]() - for val in noteNumber { - arr.append(val.asJSON()) - } - json["noteNumber"] = arr + json["noteNumber"] = noteNumber.map() { $0.asJSON() } } if let sequenceLinkId = self.sequenceLinkId { json["sequenceLinkId"] = sequenceLinkId.asJSON() @@ -1213,10 +1198,10 @@ open class ClaimResponseItem: BackboneElement { /** - * Adjudication details. - * - * The adjudications results. - */ +Adjudication details. + +The adjudications results. +*/ open class ClaimResponseItemAdjudication: BackboneElement { override open class var resourceType: String { get { return "ClaimResponseItemAdjudication" } @@ -1323,10 +1308,10 @@ open class ClaimResponseItemAdjudication: BackboneElement { /** - * Detail line items. - * - * The second tier service adjudications for submitted services. - */ +Detail line items. + +The second tier service adjudications for submitted services. +*/ open class ClaimResponseItemDetail: BackboneElement { override open class var resourceType: String { get { return "ClaimResponseItemDetail" } @@ -1413,11 +1398,7 @@ open class ClaimResponseItemDetail: BackboneElement { json["adjudication"] = adjudication.map() { $0.asJSON(errors: &errors) } } if let noteNumber = self.noteNumber { - var arr = [Any]() - for val in noteNumber { - arr.append(val.asJSON()) - } - json["noteNumber"] = arr + json["noteNumber"] = noteNumber.map() { $0.asJSON() } } if let sequenceLinkId = self.sequenceLinkId { json["sequenceLinkId"] = sequenceLinkId.asJSON() @@ -1432,10 +1413,10 @@ open class ClaimResponseItemDetail: BackboneElement { /** - * Subdetail line items. - * - * The third tier service adjudications for submitted services. - */ +Subdetail line items. + +The third tier service adjudications for submitted services. +*/ open class ClaimResponseItemDetailSubDetail: BackboneElement { override open class var resourceType: String { get { return "ClaimResponseItemDetailSubDetail" } @@ -1505,11 +1486,7 @@ open class ClaimResponseItemDetailSubDetail: BackboneElement { json["adjudication"] = adjudication.map() { $0.asJSON(errors: &errors) } } if let noteNumber = self.noteNumber { - var arr = [Any]() - for val in noteNumber { - arr.append(val.asJSON()) - } - json["noteNumber"] = arr + json["noteNumber"] = noteNumber.map() { $0.asJSON() } } if let sequenceLinkId = self.sequenceLinkId { json["sequenceLinkId"] = sequenceLinkId.asJSON() @@ -1521,10 +1498,10 @@ open class ClaimResponseItemDetailSubDetail: BackboneElement { /** - * Processing notes. - * - * Note text. - */ +Processing notes. + +Note text. +*/ open class ClaimResponseNote: BackboneElement { override open class var resourceType: String { get { return "ClaimResponseNote" } @@ -1616,10 +1593,10 @@ open class ClaimResponseNote: BackboneElement { /** - * Payment details, if paid. - * - * Payment details for the claim if the claim has been paid. - */ +Payment details, if paid. + +Payment details for the claim if the claim has been paid. +*/ open class ClaimResponsePayment: BackboneElement { override open class var resourceType: String { get { return "ClaimResponsePayment" } diff --git a/Sources/Models/ClinicalImpression.swift b/Sources/Models/ClinicalImpression.swift index 7e2db5c9..005cd7f4 100644 --- a/Sources/Models/ClinicalImpression.swift +++ b/Sources/Models/ClinicalImpression.swift @@ -2,7 +2,7 @@ // ClinicalImpression.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ClinicalImpression) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ClinicalImpression) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,14 +10,14 @@ import Foundation /** - * A clinical assessment performed when planning treatments and management strategies for a patient. - * - * A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning - * the treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 - * with a clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource - * is called "ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment - * tools such as Apgar score. - */ +A clinical assessment performed when planning treatments and management strategies for a patient. + +A record of a clinical assessment performed to determine what problem(s) may affect the patient and before planning the +treatments or management strategies that are best to manage a patient's condition. Assessments are often 1:1 with a +clinical consultation / encounter, but this varies greatly depending on the clinical workflow. This resource is called +"ClinicalImpression" rather than "ClinicalAssessment" to avoid confusion with the recording of assessment tools such as +Apgar score. +*/ open class ClinicalImpression: DomainResource { override open class var resourceType: String { get { return "ClinicalImpression" } @@ -74,8 +74,8 @@ open class ClinicalImpression: DomainResource { /// Clinical Protocol followed. public var protocol_fhir: [URL]? - /// draft | completed | entered-in-error. - public var status: String? + /// Identifies the workflow status of the assessment. + public var status: ClinicalImpressionStatus? /// Patient or group assessed. public var subject: Reference? @@ -85,7 +85,7 @@ open class ClinicalImpression: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String, subject: Reference) { + public convenience init(status: ClinicalImpressionStatus, subject: Reference) { self.init() self.status = status self.subject = subject @@ -315,7 +315,12 @@ open class ClinicalImpression: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = ClinicalImpressionStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -405,14 +410,10 @@ open class ClinicalImpression: DomainResource { json["prognosisReference"] = prognosisReference.map() { $0.asJSON(errors: &errors) } } if let protocol_fhir = self.protocol_fhir { - var arr = [Any]() - for val in protocol_fhir { - arr.append(val.asJSON()) - } - json["protocol"] = arr + json["protocol"] = protocol_fhir.map() { $0.asJSON() } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) @@ -427,10 +428,10 @@ open class ClinicalImpression: DomainResource { /** - * Possible or likely findings and diagnoses. - * - * Specific findings or diagnoses that was considered likely or relevant to ongoing treatment. - */ +Possible or likely findings and diagnoses. + +Specific findings or diagnoses that was considered likely or relevant to ongoing treatment. +*/ open class ClinicalImpressionFinding: BackboneElement { override open class var resourceType: String { get { return "ClinicalImpressionFinding" } @@ -527,12 +528,12 @@ open class ClinicalImpressionFinding: BackboneElement { /** - * One or more sets of investigations (signs, symptions, etc.). - * - * One or more sets of investigations (signs, symptions, etc.). The actual grouping of investigations vary greatly - * depending on the type and context of the assessment. These investigations may include data generated during the - * assessment process, or data previously generated and recorded that is pertinent to the outcomes. - */ +One or more sets of investigations (signs, symptions, etc.). + +One or more sets of investigations (signs, symptions, etc.). The actual grouping of investigations vary greatly +depending on the type and context of the assessment. These investigations may include data generated during the +assessment process, or data previously generated and recorded that is pertinent to the outcomes. +*/ open class ClinicalImpressionInvestigation: BackboneElement { override open class var resourceType: String { get { return "ClinicalImpressionInvestigation" } diff --git a/Sources/Models/CodeSystem.swift b/Sources/Models/CodeSystem.swift index 671f25de..b45bec49 100644 --- a/Sources/Models/CodeSystem.swift +++ b/Sources/Models/CodeSystem.swift @@ -2,7 +2,7 @@ // CodeSystem.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/CodeSystem) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/CodeSystem) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * A set of codes drawn from one or more code systems. - * - * A code system resource specifies a set of codes drawn from one or more code systems. - */ +A set of codes drawn from one or more code systems. + +A code system resource specifies a set of codes drawn from one or more code systems. +*/ open class CodeSystem: DomainResource { override open class var resourceType: String { get { return "CodeSystem" } @@ -31,8 +31,9 @@ open class CodeSystem: DomainResource { /// Contact details for the publisher. public var contact: [ContactDetail]? - /// not-present | examplar | fragment | complete. - public var content: String? + /// How much of the content of the code system - the concepts and codes it defines - are represented in this + /// resource. + public var content: CodeSystemContentMode? /// Use and/or publishing restrictions. public var copyright: String? @@ -52,8 +53,8 @@ open class CodeSystem: DomainResource { /// Filter that can be used in a value set. public var filter: [CodeSystemFilter]? - /// grouped-by | subsumes | part-of | classified-with. - public var hierarchyMeaning: String? + /// The meaning of the heirarchy of concepts. + public var hierarchyMeaning: CodeSystemHierarchyMeaning? /// Additional identifier for the code system. public var identifier: Identifier? @@ -73,8 +74,8 @@ open class CodeSystem: DomainResource { /// Why this code system is defined. public var purpose: String? - /// draft | active | retired. - public var status: String? + /// The status of this code system. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Name for this code system (Human friendly). public var title: String? @@ -96,7 +97,7 @@ open class CodeSystem: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(content: String, status: String) { + public convenience init(content: CodeSystemContentMode, status: PublicationStatus) { self.init() self.content = content self.status = status @@ -154,7 +155,12 @@ open class CodeSystem: DomainResource { if let exist = json["content"] { presentKeys.insert("content") if let val = exist as? String { - self.content = val + if let enumval = CodeSystemContentMode(rawValue: val) { + self.content = enumval + } + else { + errors.append(FHIRValidationError(key: "content", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "content", wants: String.self, has: type(of: exist))) @@ -225,7 +231,12 @@ open class CodeSystem: DomainResource { if let exist = json["hierarchyMeaning"] { presentKeys.insert("hierarchyMeaning") if let val = exist as? String { - self.hierarchyMeaning = val + if let enumval = CodeSystemHierarchyMeaning(rawValue: val) { + self.hierarchyMeaning = enumval + } + else { + errors.append(FHIRValidationError(key: "hierarchyMeaning", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "hierarchyMeaning", wants: String.self, has: type(of: exist))) @@ -303,7 +314,12 @@ open class CodeSystem: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -390,7 +406,7 @@ open class CodeSystem: DomainResource { json["contact"] = contact.map() { $0.asJSON(errors: &errors) } } if let content = self.content { - json["content"] = content.asJSON() + json["content"] = content.rawValue } if let copyright = self.copyright { json["copyright"] = copyright.asJSON() @@ -411,7 +427,7 @@ open class CodeSystem: DomainResource { json["filter"] = filter.map() { $0.asJSON(errors: &errors) } } if let hierarchyMeaning = self.hierarchyMeaning { - json["hierarchyMeaning"] = hierarchyMeaning.asJSON() + json["hierarchyMeaning"] = hierarchyMeaning.rawValue } if let identifier = self.identifier { json["identifier"] = identifier.asJSON(errors: &errors) @@ -432,7 +448,7 @@ open class CodeSystem: DomainResource { json["purpose"] = purpose.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let title = self.title { json["title"] = title.asJSON() @@ -459,11 +475,11 @@ open class CodeSystem: DomainResource { /** - * Concepts in the code system. - * - * Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must - * be consulted to determine what the meaning of the hierarchical relationships are. - */ +Concepts in the code system. + +Concepts that are in the code system. The concept definitions are inherently hierarchical, but the definitions must be +consulted to determine what the meaning of the hierarchical relationships are. +*/ open class CodeSystemConcept: BackboneElement { override open class var resourceType: String { get { return "CodeSystemConcept" } @@ -600,11 +616,11 @@ open class CodeSystemConcept: BackboneElement { /** - * Additional representations for the concept. - * - * Additional representations for the concept - other languages, aliases, specialized purposes, used for particular - * purposes, etc. - */ +Additional representations for the concept. + +Additional representations for the concept - other languages, aliases, specialized purposes, used for particular +purposes, etc. +*/ open class CodeSystemConceptDesignation: BackboneElement { override open class var resourceType: String { get { return "CodeSystemConceptDesignation" } @@ -686,10 +702,10 @@ open class CodeSystemConceptDesignation: BackboneElement { /** - * Property value for the concept. - * - * A property value for this concept. - */ +Property value for the concept. + +A property value for this concept. +*/ open class CodeSystemConceptProperty: BackboneElement { override open class var resourceType: String { get { return "CodeSystemConceptProperty" } @@ -857,10 +873,10 @@ open class CodeSystemConceptProperty: BackboneElement { /** - * Filter that can be used in a value set. - * - * A filter that can be used in a value set compose statement when selecting concepts using a filter. - */ +Filter that can be used in a value set. + +A filter that can be used in a value set compose statement when selecting concepts using a filter. +*/ open class CodeSystemFilter: BackboneElement { override open class var resourceType: String { get { return "CodeSystemFilter" } @@ -872,15 +888,15 @@ open class CodeSystemFilter: BackboneElement { /// How or why the filter is used. public var description_fhir: String? - /// Operators that can be used with filter. - public var operator_fhir: [String]? + /// A list of operators that can be used with the filter. + public var operator_fhir: [FilterOperator]? /// What to use for the value. public var value: String? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(code: String, operator_fhir: [String], value: String) { + public convenience init(code: String, operator_fhir: [FilterOperator], value: String) { self.init() self.code = code self.operator_fhir = operator_fhir @@ -913,8 +929,12 @@ open class CodeSystemFilter: BackboneElement { } if let exist = json["operator"] { presentKeys.insert("operator") - if let val = exist as? [String] { - self.operator_fhir = val + if let val = exist as? [String] { var i = -1 + self.operator_fhir = val.map() { i += 1 + if let enumval = FilterOperator(rawValue: $0) { return enumval } + errors.append(FHIRValidationError(key: "operator_fhir.\(i)", problem: "the value “\(val)” is not valid")) + return nil + }.filter() { nil != $0 }.map() { $0! } } else { errors.append(FHIRValidationError(key: "operator", wants: Array.self, has: type(of: exist))) @@ -948,11 +968,7 @@ open class CodeSystemFilter: BackboneElement { json["description"] = description_fhir.asJSON() } if let operator_fhir = self.operator_fhir { - var arr = [Any]() - for val in operator_fhir { - arr.append(val.asJSON()) - } - json["operator"] = arr + json["operator"] = operator_fhir.map() { $0.rawValue } } if let value = self.value { json["value"] = value.asJSON() @@ -964,10 +980,10 @@ open class CodeSystemFilter: BackboneElement { /** - * Additional information supplied about each concept. - * - * A property defines an additional slot through which additional information can be provided about a concept. - */ +Additional information supplied about each concept. + +A property defines an additional slot through which additional information can be provided about a concept. +*/ open class CodeSystemProperty: BackboneElement { override open class var resourceType: String { get { return "CodeSystemProperty" } @@ -979,15 +995,16 @@ open class CodeSystemProperty: BackboneElement { /// Why the property is defined, and/or what it conveys. public var description_fhir: String? - /// code | Coding | string | integer | boolean | dateTime. - public var type: String? + /// The type of the property value. Properties of type "code" contain a code defined by the code system (e.g. a + /// reference to anotherr defined concept). + public var type: PropertyType? /// Formal identifier for the property. public var uri: URL? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(code: String, type: String) { + public convenience init(code: String, type: PropertyType) { self.init() self.code = code self.type = type @@ -1020,7 +1037,12 @@ open class CodeSystemProperty: BackboneElement { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = PropertyType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -1051,7 +1073,7 @@ open class CodeSystemProperty: BackboneElement { json["description"] = description_fhir.asJSON() } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } if let uri = self.uri { json["uri"] = uri.asJSON() diff --git a/Sources/Models/CodeSystems.swift b/Sources/Models/CodeSystems.swift new file mode 100644 index 00000000..9cb2b5e7 --- /dev/null +++ b/Sources/Models/CodeSystems.swift @@ -0,0 +1,6213 @@ +// +// CodeSystems.swift +// SwiftFHIR +// +// Generated from FHIR 1.7.0.10127 on 2016-11-04. +// 2016, SMART Health IT. +// + + +/** +A type defined by FHIR that is an abstract type + +URL: http://hl7.org/fhir/abstract-types +ValueSet: http://hl7.org/fhir/ValueSet/abstract-types +*/ +public enum AbstractType: String { + + /// A place holder that means any kind of data type + case type = "Type" + + /// A place holder that means any kind of resource + case any = "Any" +} + + +/** +Indicates whether the account is available to be used. + +URL: http://hl7.org/fhir/account-status +ValueSet: http://hl7.org/fhir/ValueSet/account-status +*/ +public enum AccountStatus: String { + + /// This account is active and may be used. + case active = "active" + + /// This account is inactive and should not be used to track financial information. + case inactive = "inactive" + + /// This instance should not have been part of this patient's medical record. + case enteredInError = "entered-in-error" +} + + +/** +List of allowable action which this resource can request. + +URL: http://hl7.org/fhir/actionlist +ValueSet: http://hl7.org/fhir/ValueSet/actionlist +*/ +public enum ActionList: String { + + /// Cancel, reverse or nullify the target resource. + case cancel = "cancel" + + /// Check for previously un-read/ not-retrieved resources. + case poll = "poll" + + /// Re-process the target resource. + case reprocess = "reprocess" + + /// Retrieve the processing status of the target resource. + case status = "status" +} + + +/** +High-level categorization of the type of activity in a protocol. + +URL: http://hl7.org/fhir/activity-definition-category +ValueSet: http://hl7.org/fhir/ValueSet/activity-definition-category +*/ +public enum ActivityDefinitionCategory: String { + + /// To communicate with a participant in some way + case communication = "communication" + + /// To use a specific device + case device = "device" + + /// To perform a particular diagnostic + case diagnostic = "diagnostic" + + /// To consume food of a specified nature + case diet = "diet" + + /// To consume/receive a drug or other product + case drug = "drug" + + /// To meet with the patient (in-patient, out-patient, etc.) + case encounter = "encounter" + + /// To administer a particular immunization + case immunization = "immunization" + + /// To capture information about a patient (vitals, labs, etc.) + case observation = "observation" + + /// To modify the patient in some way (surgery, physiotherapy, education, counseling, etc.) + case procedure = "procedure" + + /// To refer the patient to receive some service + case referral = "referral" + + /// To provide something to the patient (medication, medical supply, etc.) + case supply = "supply" + + /// To receive a particular vision correction device + case vision = "vision" + + /// Some other form of action + case other = "other" +} + + +/** +The type of an address (physical / postal) + +URL: http://hl7.org/fhir/address-type +ValueSet: http://hl7.org/fhir/ValueSet/address-type +*/ +public enum AddressType: String { + + /// Mailing addresses - PO Boxes and care-of addresses. + case postal = "postal" + + /// A physical address that can be visited. + case physical = "physical" + + /// An address that is both physical and postal. + case both = "both" +} + + +/** +The use of an address + +URL: http://hl7.org/fhir/address-use +ValueSet: http://hl7.org/fhir/ValueSet/address-use +*/ +public enum AddressUse: String { + + /// A communication address at a home. + case home = "home" + + /// An office address. First choice for business related contacts during business hours. + case work = "work" + + /// A temporary address. The period can provide more detailed information. + case temp = "temp" + + /// This address is no longer in use (or was never correct, but retained for records). + case old = "old" +} + + +/** +The gender of a person used for administrative purposes. + +URL: http://hl7.org/fhir/administrative-gender +ValueSet: http://hl7.org/fhir/ValueSet/administrative-gender +*/ +public enum AdministrativeGender: String { + + /// Male + case male = "male" + + /// Female + case female = "female" + + /// Other + case other = "other" + + /// Unknown + case unknown = "unknown" +} + + +/** +How resource references can be aggregated. + +URL: http://hl7.org/fhir/resource-aggregation-mode +ValueSet: http://hl7.org/fhir/ValueSet/resource-aggregation-mode +*/ +public enum AggregationMode: String { + + /// The reference is a local reference to a contained resource. + case contained = "contained" + + /// The reference to a resource that has to be resolved externally to the resource that includes the reference. + case referenced = "referenced" + + /// The resource the reference points to will be found in the same bundle as the resource that includes the + /// reference. + case bundled = "bundled" +} + + +/** +Category of an identified substance. + +URL: http://hl7.org/fhir/allergy-intolerance-category +ValueSet: http://hl7.org/fhir/ValueSet/allergy-intolerance-category +*/ +public enum AllergyIntoleranceCategory: String { + + /// Any substance consumed to provide nutritional support for the body. + case food = "food" + + /// Substances administered to achieve a physiological effect. + case medication = "medication" + + /// A preparation that is synthesized from living organisms or their products, especially a human or animal protein, + /// such as a hormone or antitoxin, that is used as a diagnostic, preventive, or therapeutic agent. Also called + /// biological drug. Examples of biologic medications include: vaccines; allergenic extracts, which are used for + /// both diagnosis and treatment (for example, allergy shots); gene therapies; cellular therapies. There are other + /// biologic products, such as tissues, that are not typically associated with allergies. + case biologic = "biologic" + + /// Any substances that are encountered in the environment, including any substance not already classified as food, + /// medication, or biologic. + case environment = "environment" +} + + +/** +Statement about the degree of clinical certainty that a specific substance was the cause of the manifestation in an +reaction event. + +URL: http://hl7.org/fhir/reaction-event-certainty +ValueSet: http://hl7.org/fhir/ValueSet/reaction-event-certainty +*/ +public enum AllergyIntoleranceCertainty: String { + + /// There is a low level of clinical certainty that the reaction was caused by the identified substance. + case unlikely = "unlikely" + + /// There is a high level of clinical certainty that the reaction was caused by the identified substance. + case likely = "likely" + + /// There is a very high level of clinical certainty that the reaction was due to the identified substance, which + /// may include clinical evidence by testing or rechallenge. + case confirmed = "confirmed" + + /// The clinical certainty that the reaction was caused by the identified substance is unknown. It is an explicit + /// assertion that certainty is not known. + case unknown = "unknown" +} + + +/** +Estimate of the potential clinical harm, or seriousness, of a reaction to an identified substance. + +URL: http://hl7.org/fhir/allergy-intolerance-criticality +ValueSet: http://hl7.org/fhir/ValueSet/allergy-intolerance-criticality +*/ +public enum AllergyIntoleranceCriticality: String { + + /// Worst case result of a future exposure is not assessed to be life-threatening or having high potential for organ + /// system failure. + case low = "low" + + /// Worst case result of a future exposure is assessed to be life-threatening or having high potential for organ + /// system failure. + case high = "high" + + /// Unable to assess the worst case result of a future exposure. + case unableToAssess = "unable-to-assess" +} + + +/** +Clinical assessment of the severity of a reaction event as a whole, potentially considering multiple different +manifestations. + +URL: http://hl7.org/fhir/reaction-event-severity +ValueSet: http://hl7.org/fhir/ValueSet/reaction-event-severity +*/ +public enum AllergyIntoleranceSeverity: String { + + /// Causes mild physiological effects. + case mild = "mild" + + /// Causes moderate physiological effects. + case moderate = "moderate" + + /// Causes severe physiological effects. + case severe = "severe" +} + + +/** +Assertion about certainty associated with a propensity, or potential risk, of a reaction to the identified substance. + +URL: http://hl7.org/fhir/allergy-intolerance-status +ValueSet: http://hl7.org/fhir/ValueSet/allergy-intolerance-status +*/ +public enum AllergyIntoleranceStatus: String { + + /// An active record of a risk of a reaction to the identified substance. + case active = "active" + + /// A high level of certainty about the propensity for a reaction to the identified substance, which may include + /// clinical evidence by testing or rechallenge. + case activeConfirmed = "active-confirmed" + + /// An inactivated record of a risk of a reaction to the identified substance + case inactive = "inactive" + + /// A reaction to the identified substance has been clinically reassessed by testing or re-exposure and considered + /// to be resolved + case resolved = "resolved" + + /// A propensity for a reaction to the identified substance has been disproven with a high level of clinical + /// certainty, which may include testing or rechallenge, and is refuted. + case refuted = "refuted" + + /// The statement was entered in error and is not valid. + case enteredInError = "entered-in-error" +} + + +/** +The risk of an adverse reaction (allergy or intolerance) for this patient upon xposure to the substance (including +pharmaceutical products). + +URL: http://hl7.org/fhir/allerg-intol-substance-exp-risk +ValueSet: http://hl7.org/fhir/ValueSet/allerg-intol-substance-exp-risk +*/ +public enum AllergyIntoleranceSubstanceExposureRisk: String { + + /// Known risk of allergy or intolerance reaction upon exposure to the specified substance. + case knownReactionRisk = "known-reaction-risk" + + /// No known risk of allergy or intolerance reaction upon exposure to the specified substance. + case noKnownReactionRisk = "no-known-reaction-risk" +} + + +/** +Identification of the underlying physiological mechanism for a Reaction Risk. + +URL: http://hl7.org/fhir/allergy-intolerance-type +ValueSet: http://hl7.org/fhir/ValueSet/allergy-intolerance-type +*/ +public enum AllergyIntoleranceType: String { + + /// A propensity for hypersensitivity reaction(s) to a substance. These reactions are most typically type I + /// hypersensitivity, plus other "allergy-like" reactions, including pseudoallergy. + case allergy = "allergy" + + /// A propensity for adverse reactions to a substance that is not judged to be allergic or "allergy-like". These + /// reactions are typically (but not necessarily) non-immune. They are to some degree idiosyncratic and/or + /// individually specific (i.e. are not a reaction that is expected to occur with most or all patients given similar + /// circumstances). + case intolerance = "intolerance" +} + + +/** +The free/busy status of an appointment. + +URL: http://hl7.org/fhir/appointmentstatus +ValueSet: http://hl7.org/fhir/ValueSet/appointmentstatus +*/ +public enum AppointmentStatus: String { + + /// None of the participant(s) have finalized their acceptance of the appointment request, and the start/end time + /// may not be set yet. + case proposed = "proposed" + + /// Some or all of the participant(s) have not finalized their acceptance of the appointment request. + case pending = "pending" + + /// All participant(s) have been considered and the appointment is confirmed to go ahead at the date/times + /// specified. + case booked = "booked" + + /// Some of the patients have arrived. + case arrived = "arrived" + + /// This appointment has completed and may have resulted in an encounter. + case fulfilled = "fulfilled" + + /// The appointment has been cancelled. + case cancelled = "cancelled" + + /// Some or all of the participant(s) have not/did not appear for the appointment (usually the patient). + case noshow = "noshow" + + /// This instance should not have been part of this patient's medical record. + case enteredInError = "entered-in-error" +} + + +/** +The type of direction to use for assertion. + +URL: http://hl7.org/fhir/assert-direction-codes +ValueSet: http://hl7.org/fhir/ValueSet/assert-direction-codes +*/ +public enum AssertionDirectionType: String { + + /// The assertion is evaluated on the response. This is the default value. + case response = "response" + + /// The assertion is evaluated on the request. + case request = "request" +} + + +/** +The type of operator to use for assertion. + +URL: http://hl7.org/fhir/assert-operator-codes +ValueSet: http://hl7.org/fhir/ValueSet/assert-operator-codes +*/ +public enum AssertionOperatorType: String { + + /// Default value. Equals comparison. + case equals = "equals" + + /// Not equals comparison. + case notEquals = "notEquals" + + /// Compare value within a known set of values. + case `in` = "in" + + /// Compare value not within a known set of values. + case notIn = "notIn" + + /// Compare value to be greater than a known value. + case greaterThan = "greaterThan" + + /// Compare value to be less than a known value. + case lessThan = "lessThan" + + /// Compare value is empty. + case empty = "empty" + + /// Compare value is not empty. + case notEmpty = "notEmpty" + + /// Compare value string contains a known value. + case contains = "contains" + + /// Compare value string does not contain a known value. + case notContains = "notContains" + + /// Evaluate the fhirpath expression as a boolean condition. + case eval = "eval" +} + + +/** +The type of response code to use for assertion. + +URL: http://hl7.org/fhir/assert-response-code-types +ValueSet: http://hl7.org/fhir/ValueSet/assert-response-code-types +*/ +public enum AssertionResponseTypes: String { + + /// Response code is 200. + case okay = "okay" + + /// Response code is 201. + case created = "created" + + /// Response code is 204. + case noContent = "noContent" + + /// Response code is 304. + case notModified = "notModified" + + /// Response code is 400. + case bad = "bad" + + /// Response code is 403. + case forbidden = "forbidden" + + /// Response code is 404. + case notFound = "notFound" + + /// Response code is 405. + case methodNotAllowed = "methodNotAllowed" + + /// Response code is 409. + case conflict = "conflict" + + /// Response code is 410. + case gone = "gone" + + /// Response code is 412. + case preconditionFailed = "preconditionFailed" + + /// Response code is 422. + case unprocessable = "unprocessable" +} + + +/** +Indicator for type of action performed during the event that generated the audit. + +URL: http://hl7.org/fhir/audit-event-action +ValueSet: http://hl7.org/fhir/ValueSet/audit-event-action +*/ +public enum AuditEventAction: String { + + /// Create a new database object, such as placing an order. + case C = "C" + + /// Display or print data, such as a doctor census. + case R = "R" + + /// Update data, such as revise patient information. + case U = "U" + + /// Delete items, such as a doctor master file record. + case D = "D" + + /// Perform a system or application function such as log-on, program execution or use of an object's method, or + /// perform a query/search operation. + case E = "E" +} + + +/** +Indication of the degree of conformance expectations associated with a binding. + +URL: http://hl7.org/fhir/binding-strength +ValueSet: http://hl7.org/fhir/ValueSet/binding-strength +*/ +public enum BindingStrength: String { + + /// To be conformant, instances of this element SHALL include a code from the specified value set. + case required = "required" + + /// To be conformant, instances of this element SHALL include a code from the specified value set if any of the + /// codes within the value set can apply to the concept being communicated. If the value set does not cover the + /// concept (based on human review), alternate codings (or, data type allowing, text) may be included instead. + case extensible = "extensible" + + /// Instances are encouraged to draw from the specified codes for interoperability purposes but are not required to + /// do so to be considered conformant. + case preferred = "preferred" + + /// Instances are not expected or even encouraged to draw from the specified value set. The value set merely + /// provides examples of the types of concepts intended to be included. + case example = "example" +} + + +/** +Indicates the purpose of a bundle - how it was intended to be used. + +URL: http://hl7.org/fhir/bundle-type +ValueSet: http://hl7.org/fhir/ValueSet/bundle-type +*/ +public enum BundleType: String { + + /// The bundle is a document. The first resource is a Composition. + case document = "document" + + /// The bundle is a message. The first resource is a MessageHeader. + case message = "message" + + /// The bundle is a transaction - intended to be processed by a server as an atomic commit. + case transaction = "transaction" + + /// The bundle is a transaction response. Because the response is a transaction response, the transaction has + /// succeeded, and all responses are error free. + case transactionResponse = "transaction-response" + + /// The bundle is a transaction - intended to be processed by a server as a group of actions. + case batch = "batch" + + /// The bundle is a batch response. Note that as a batch, some responses may indicate failure and others success. + case batchResponse = "batch-response" + + /// The bundle is a list of resources from a history interaction on a server. + case history = "history" + + /// The bundle is a list of resources returned as a result of a search/query interaction, operation, or message. + case searchset = "searchset" + + /// The bundle is a set of resources collected into a single document for ease of distribution. + case collection = "collection" +} + + +/** +How a capability statement is intended to be used. + +URL: http://hl7.org/fhir/capability-statement-kind +ValueSet: http://hl7.org/fhir/ValueSet/capability-statement-kind +*/ +public enum CapabilityStatementKind: String { + + /// The CapabilityStatement instance represents the present capabilities of a specific system instance. This is the + /// kind returned by OPTIONS for a FHIR server end-point. + case instance = "instance" + + /// The CapabilityStatement instance represents the capabilities of a system or piece of software, independent of a + /// particular installation. + case capability = "capability" + + /// The CapabilityStatement instance represents a set of requirements for other systems to meet; e.g. as part of an + /// implementation guide or 'request for proposal'. + case requirements = "requirements" +} + + +/** +Indicates where the activity is at in its overall life cycle. + +URL: http://hl7.org/fhir/care-plan-activity-status +ValueSet: http://hl7.org/fhir/ValueSet/care-plan-activity-status +*/ +public enum CarePlanActivityStatus: String { + + /// Activity is planned but no action has yet been taken. + case notStarted = "not-started" + + /// Appointment or other booking has occurred but activity has not yet begun. + case scheduled = "scheduled" + + /// Activity has been started but is not yet complete. + case inProgress = "in-progress" + + /// Activity was started but has temporarily ceased with an expectation of resumption at a future time. + case onHold = "on-hold" + + /// The activities have been completed (more or less) as planned. + case completed = "completed" + + /// The activities have been ended prior to completion (perhaps even before they were started). + case cancelled = "cancelled" + + /// The authoring system doesn't know the current state of the activity. + case unknown = "unknown" +} + + +/** +Codes identifying the types of relationships between two plans. + +URL: http://hl7.org/fhir/care-plan-relationship +ValueSet: http://hl7.org/fhir/ValueSet/care-plan-relationship +*/ +public enum CarePlanRelationship: String { + + /// The referenced plan is considered to be part of this plan. + case includes = "includes" + + /// This plan takes the places of the referenced plan. + case replaces = "replaces" + + /// This plan provides details about how to perform activities defined at a higher level by the referenced plan. + case fulfills = "fulfills" +} + + +/** +Indicates whether the plan is currently being acted upon, represents future intentions or is now a historical record. + +URL: http://hl7.org/fhir/care-plan-status +ValueSet: http://hl7.org/fhir/ValueSet/care-plan-status +*/ +public enum CarePlanStatus: String { + + /// The plan has been suggested but no commitment to it has yet been made. + case proposed = "proposed" + + /// The plan is in development or awaiting use but is not yet intended to be acted upon. + case draft = "draft" + + /// The plan is intended to be followed and used as part of patient care. + case active = "active" + + /// The plan has been temporarily stopped but is expected to resume in the future. + case suspended = "suspended" + + /// The plan is no longer in use and is not expected to be followed or used in patient care. + case completed = "completed" + + /// The plan was entered in error and voided. + case enteredInError = "entered-in-error" + + /// The plan has been terminated prior to reaching completion (though it may have been replaced by a new plan). + case cancelled = "cancelled" + + /// The authoring system doesn't know the current state of the care plan. + case unknown = "unknown" +} + + +/** +Direction in which lists of question options should be displayed + +URL: http://hl7.org/fhir/choice-list-orientation +ValueSet: http://hl7.org/fhir/ValueSet/choice-list-orientation +*/ +public enum ChoiceListOrientation: String { + + /// List choices along the horizontal axis + case horizontal = "horizontal" + + /// List choices down the vertical axis + case vertical = "vertical" +} + + +/** +A code specifying the state of the resource instance. + +URL: http://hl7.org/fhir/claimresponse-status +ValueSet: http://hl7.org/fhir/ValueSet/claimresponse-status +*/ +public enum ClaimResponseStatus: String { + + /// The resource instance is currently in-force. + case active = "active" + + /// The resource instance is withdrawn, rescinded or reversed. + case cancelled = "cancelled" + + /// A new resource instance the contents of which is not complete. + case draft = "draft" + + /// The resource instance was entered in error. + case enteredInError = "entered-in-error" +} + + +/** +A code specifying the state of the resource instance. + +URL: http://hl7.org/fhir/claim-status +ValueSet: http://hl7.org/fhir/ValueSet/claim-status +*/ +public enum ClaimStatus: String { + + /// The resource instance is currently in-force. + case active = "active" + + /// The resource instance is withdrawn, rescinded or reversed. + case cancelled = "cancelled" + + /// A new resource instance the contents of which is not complete. + case draft = "draft" + + /// The resource instance was entered in error. + case enteredInError = "entered-in-error" +} + + +/** +Identifies whether a useContext represents a context or classification for the element + +URL: http://hl7.org/fhir/classification-or-context +ValueSet: http://hl7.org/fhir/ValueSet/classification-or-context +*/ +public enum ClassificationOrContext: String { + + /// Indicates the useContext is a classification - e.g. Administrative, financial, etc. + case classification = "classification" + + /// Indicates the useContext is a context - a domain of use - e.g. Particular country, organization or system + case context = "context" +} + + +/** +The workflow state of a clinical impression. + +URL: http://hl7.org/fhir/clinical-impression-status +ValueSet: http://hl7.org/fhir/ValueSet/clinical-impression-status +*/ +public enum ClinicalImpressionStatus: String { + + /// The assessment is still on-going and results are not yet final. + case draft = "draft" + + /// The assessment is done and the results are final. + case completed = "completed" + + /// This assessment was never actually done and the record is erroneous (e.g. Wrong patient). + case enteredInError = "entered-in-error" +} + + +/** +How much of the content of the code system - the concepts and codes it defines - are represented in a code system +resource + +URL: http://hl7.org/fhir/codesystem-content-mode +ValueSet: http://hl7.org/fhir/ValueSet/codesystem-content-mode +*/ +public enum CodeSystemContentMode: String { + + /// None of the concepts defined by the code system are included in the code system resource + case notPresent = "not-present" + + /// A few representative concepts are included in the code system resource + case examplar = "examplar" + + /// A subset of the code system concepts are included in the code system resource + case fragment = "fragment" + + /// All the concepts defined by the code system are included in the code system resource + case complete = "complete" +} + + +/** +The meaning of the hierarchy of concepts in a code system + +URL: http://hl7.org/fhir/codesystem-hierarchy-meaning +ValueSet: http://hl7.org/fhir/ValueSet/codesystem-hierarchy-meaning +*/ +public enum CodeSystemHierarchyMeaning: String { + + /// No particular relationship between the concepts can be assumed, except what can be determined by inspection of + /// the definitions of the elements (possible reasons to use this: importing from a source where this is not + /// defined, or where various parts of the heirarchy have different meanings) + case groupedBy = "grouped-by" + + /// A hierarchy where the child concepts are "a kind of" the parent (typically an IS-A relationship.) + case subsumes = "subsumes" + + /// Child elements list the individual parts of a composite whole (e.g. bodysite) + case partOf = "part-of" + + /// Child concepts in the hierarchy may have only one parent and there is a presumption that the code system is a + /// "closed world" meaning all things must be in the hierarchy. This results in concepts such as "not otherwise + /// clasified." + case classifiedWith = "classified-with" +} + + +/** +The status of the communication. + +URL: http://hl7.org/fhir/communication-request-status +ValueSet: http://hl7.org/fhir/ValueSet/communication-request-status +*/ +public enum CommunicationRequestStatus: String { + + /// The request has been proposed. + case proposed = "proposed" + + /// The request has been planned. + case planned = "planned" + + /// The request has been placed. + case requested = "requested" + + /// The receiving system has received the request but not yet decided whether it will be performed. + case received = "received" + + /// The receiving system has accepted the order, but work has not yet commenced. + case accepted = "accepted" + + /// The work to fulfill the order is happening. + case inProgress = "in-progress" + + /// The work has been complete, the report(s) released, and no further work is planned. + case completed = "completed" + + /// The request has been held by originating system/user request. + case suspended = "suspended" + + /// The receiving system has declined to fulfill the request + case rejected = "rejected" + + /// The communication was attempted, but due to some procedural error, it could not be completed. + case failed = "failed" +} + + +/** +The status of the communication. + +URL: http://hl7.org/fhir/communication-status +ValueSet: http://hl7.org/fhir/ValueSet/communication-status +*/ +public enum CommunicationStatus: String { + + /// The communication transmission is ongoing. + case inProgress = "in-progress" + + /// The message transmission is complete, i.e., delivered to the recipient's destination. + case completed = "completed" + + /// The communication transmission has been held by originating system/user request. + case suspended = "suspended" + + /// The receiving system has declined to accept the message. + case rejected = "rejected" + + /// There was a failure in transmitting the message out. + case failed = "failed" +} + + +/** +Which compartment a compartmnet definition describes + +URL: http://hl7.org/fhir/compartment-type +ValueSet: http://hl7.org/fhir/ValueSet/compartment-type +*/ +public enum CompartmentType: String { + + /// The compartment definition is for the patient compartment + case patient = "Patient" + + /// The compartment definition is for the encounter compartment + case encounter = "Encounter" + + /// The compartment definition is for the related-person compartment + case relatedPerson = "RelatedPerson" + + /// The compartment definition is for the practitioner compartment + case practitioner = "Practitioner" + + /// The compartment definition is for the device compartment + case device = "Device" +} + + +/** +The way in which a person authenticated a composition. + +URL: http://hl7.org/fhir/composition-attestation-mode +ValueSet: http://hl7.org/fhir/ValueSet/composition-attestation-mode +*/ +public enum CompositionAttestationMode: String { + + /// The person authenticated the content in their personal capacity. + case personal = "personal" + + /// The person authenticated the content in their professional capacity. + case professional = "professional" + + /// The person authenticated the content and accepted legal responsibility for its content. + case legal = "legal" + + /// The organization authenticated the content as consistent with their policies and procedures. + case official = "official" +} + + +/** +The workflow/clinical status of the composition. + +URL: http://hl7.org/fhir/composition-status +ValueSet: http://hl7.org/fhir/ValueSet/composition-status +*/ +public enum CompositionStatus: String { + + /// This is a preliminary composition or document (also known as initial or interim). The content may be incomplete + /// or unverified. + case preliminary = "preliminary" + + /// This version of the composition is complete and verified by an appropriate person and no further work is + /// planned. Any subsequent updates would be on a new version of the composition. + case final = "final" + + /// The composition content or the referenced resources have been modified (edited or added to) subsequent to being + /// released as "final" and the composition is complete and verified by an authorized person. + case amended = "amended" + + /// The composition or document was originally created/issued in error, and this is an amendment that marks that the + /// entire series should not be considered as valid. + case enteredInError = "entered-in-error" +} + + +/** +The degree of equivalence between concepts. + +URL: http://hl7.org/fhir/concept-map-equivalence +ValueSet: http://hl7.org/fhir/ValueSet/concept-map-equivalence +*/ +public enum ConceptMapEquivalence: String { + + /// The concepts are related to each other, and have at least some overlap in meaning, but the exact relationship is + /// not known + case relatedto = "relatedto" + + /// The definitions of the concepts mean the same thing (including when structural implications of meaning are + /// considered) (i.e. extensionally identical). + case equivalent = "equivalent" + + /// The definitions of the concepts are exactly the same (i.e. only grammatical differences) and structural + /// implications of meaning are identical or irrelevant (i.e. intentionally identical). + case equal = "equal" + + /// The target mapping is wider in meaning than the source concept. + case wider = "wider" + + /// The target mapping subsumes the meaning of the source concept (e.g. the source is-a target). + case subsumes = "subsumes" + + /// The target mapping is narrower in meaning than the source concept. The sense in which the mapping is narrower + /// SHALL be described in the comments in this case, and applications should be careful when attempting to use these + /// mappings operationally. + case narrower = "narrower" + + /// The target mapping specializes the meaning of the source concept (e.g. the target is-a source). + case specializes = "specializes" + + /// The target mapping overlaps with the source concept, but both source and target cover additional meaning, or the + /// definitions are imprecise and it is uncertain whether they have the same boundaries to their meaning. The sense + /// in which the mapping is narrower SHALL be described in the comments in this case, and applications should be + /// careful when attempting to use these mappings operationally. + case inexact = "inexact" + + /// There is no match for this concept in the destination concept system. + case unmatched = "unmatched" + + /// This is an explicit assertion that there is no mapping between the source and target concept. + case disjoint = "disjoint" +} + + +/** +Enumeration indicating whether the condition is currently active, inactive, or has been resolved. + +URL: http://hl7.org/fhir/condition-state +ValueSet: http://hl7.org/fhir/ValueSet/condition-state +*/ +public enum ConditionState: String { + + /// The condition is active. + case active = "active" + + /// The condition inactive but not resolved. + case inactive = "inactive" + + /// The condition is resolved. + case resolved = "resolved" +} + + +/** +The verification status to support or decline the clinical status of the condition or diagnosis. + +URL: http://hl7.org/fhir/condition-ver-status +ValueSet: http://hl7.org/fhir/ValueSet/condition-ver-status +*/ +public enum ConditionVerificationStatus: String { + + /// This is a tentative diagnosis - still a candidate that is under consideration. + case provisional = "provisional" + + /// One of a set of potential (and typically mutually exclusive) diagnosis asserted to further guide the diagnostic + /// process and preliminary treatment. + case differential = "differential" + + /// There is sufficient diagnostic and/or clinical evidence to treat this as a confirmed condition. + case confirmed = "confirmed" + + /// This condition has been ruled out by diagnostic and clinical evidence. + case refuted = "refuted" + + /// The statement was entered in error and is not valid. + case enteredInError = "entered-in-error" + + /// The condition status is unknown. Note that "unknown" is a value of last resort and every attempt should be made + /// to provide a meaningful value other than "unknown". + case unknown = "unknown" +} + + +/** +A code that indicates how the server supports conditional delete. + +URL: http://hl7.org/fhir/conditional-delete-status +ValueSet: http://hl7.org/fhir/ValueSet/conditional-delete-status +*/ +public enum ConditionalDeleteStatus: String { + + /// No support for conditional deletes. + case notSupported = "not-supported" + + /// Conditional deletes are supported, but only single resources at a time. + case single = "single" + + /// Conditional deletes are supported, and multiple resources can be deleted in a single interaction. + case multiple = "multiple" +} + + +/** +A code that indicates how the server supports conditional read. + +URL: http://hl7.org/fhir/conditional-read-status +ValueSet: http://hl7.org/fhir/ValueSet/conditional-read-status +*/ +public enum ConditionalReadStatus: String { + + /// No support for conditional deletes. + case notSupported = "not-supported" + + /// Conditional reads are supported, but only with the If-Modified-Since HTTP Header. + case modifiedSince = "modified-since" + + /// Conditional reads are supported, but only with the If-None-Match HTTP Header. + case notMatch = "not-match" + + /// Conditional reads are supported, with both If-Modified-Since and If-None-Match HTTP Headers. + case fullSupport = "full-support" +} + + +/** +Indicates the degree of adherence to a specified behavior or capability expected in order for a system to be deemed +conformant with a specification. + +URL: http://hl7.org/fhir/conformance-expectation +ValueSet: http://hl7.org/fhir/ValueSet/conformance-expectation +*/ +public enum ConformanceExpectation: String { + + /// Support for the specified capability is required to be considered conformant. + case SHALL = "SHALL" + + /// Support for the specified capability is strongly encouraged and failure to support it should only occur after + /// careful consideration. + case SHOULD = "SHOULD" + + /// Support for the specified capability is not necessary to be considered conformant and the requirement should be + /// considered strictly optional. + case MAY = "MAY" + + /// Support for the specified capability is strongly discouraged and should occur only after careful consideration. + case SHOULDNOT = "SHOULD-NOT" +} + + +/** +How a resource reference is interpreted when testing consent restrictions + +URL: http://hl7.org/fhir/consent-data-meaning +ValueSet: http://hl7.org/fhir/ValueSet/consent-data-meaning +*/ +public enum ConsentDataMeaning: String { + + /// The consent applies directly to the instance of the resource + case instance = "instance" + + /// The consent applies directly to the instance of the resource, and instances it refers to + case related = "related" + + /// The consent applies directly to the instance of the resource, and instances that refer to it + case dependents = "dependents" +} + + +/** +How an exception is statement is applied, as adding additional consent, or removing consent + +URL: http://hl7.org/fhir/consent-except-type +ValueSet: http://hl7.org/fhir/ValueSet/consent-except-type +*/ +public enum ConsentExceptType: String { + + /// Consent is denied for actions meeting these rules + case deny = "deny" + + /// Consent is provided for actions meeting these rules + case permit = "permit" +} + + +/** +Indicates the status of the consent + +URL: http://hl7.org/fhir/consent-status +ValueSet: http://hl7.org/fhir/ValueSet/consent-status +*/ +public enum ConsentStatus: String { + + /// The consent is in development or awaiting use but is not yet intended to be acted upon. + case draft = "draft" + + /// The consent has be proposed but not yet agreed to by all parties. The negotiation stage. + case proposed = "proposed" + + /// The consent is to be followed and enforced. + case active = "active" + + /// The consent has been rejected by one or more of the parties. + case rejected = "rejected" + + /// The consent is terminated or replaced. + case inactive = "inactive" + + /// The consent was created wrongly (e.g. wrong patient) and should be ignored + case enteredInError = "entered-in-error" +} + + +/** +SHALL applications comply with this constraint? + +URL: http://hl7.org/fhir/constraint-severity +ValueSet: http://hl7.org/fhir/ValueSet/constraint-severity +*/ +public enum ConstraintSeverity: String { + + /// If the constraint is violated, the resource is not conformant. + case error = "error" + + /// If the constraint is violated, the resource is conformant, but it is not necessarily following best practice. + case warning = "warning" +} + + +/** +Telecommunications form for contact point + +URL: http://hl7.org/fhir/contact-point-system +ValueSet: http://hl7.org/fhir/ValueSet/contact-point-system +*/ +public enum ContactPointSystem: String { + + /// The value is a telephone number used for voice calls. Use of full international numbers starting with + is + /// recommended to enable automatic dialing support but not required. + case phone = "phone" + + /// The value is a fax machine. Use of full international numbers starting with + is recommended to enable automatic + /// dialing support but not required. + case fax = "fax" + + /// The value is an email address. + case email = "email" + + /// The value is a pager number. These may be local pager numbers that are only usable on a particular pager system. + case pager = "pager" + + /// A contact that is not a phone, fax, or email address. The format of the value SHOULD be a URL. This is intended + /// for various personal contacts including blogs, Twitter, Facebook, etc. Do not use for email addresses. If this + /// is not a URL, then it will require human interpretation. + case other = "other" +} + + +/** +Use of contact point + +URL: http://hl7.org/fhir/contact-point-use +ValueSet: http://hl7.org/fhir/ValueSet/contact-point-use +*/ +public enum ContactPointUse: String { + + /// A communication contact point at a home; attempted contacts for business purposes might intrude privacy and + /// chances are one will contact family or other household members instead of the person one wishes to call. + /// Typically used with urgent cases, or if no other contacts are available. + case home = "home" + + /// An office contact point. First choice for business related contacts during business hours. + case work = "work" + + /// A temporary contact point. The period can provide more detailed information. + case temp = "temp" + + /// This contact point is no longer in use (or was never correct, but retained for records). + case old = "old" + + /// A telecommunication device that moves and stays with its owner. May have characteristics of all other use codes, + /// suitable for urgent matters, not the first choice for routine business. + case mobile = "mobile" +} + + +/** +The content or mime type. + +URL: http://hl7.org/fhir/content-type +ValueSet: http://hl7.org/fhir/ValueSet/content-type +*/ +public enum ContentType: String { + + /// XML content-type corresponding to the application/fhir+xml mime-type. + case xml = "xml" + + /// JSON content-type corresponding to the application/fhir+json mime-type. + case json = "json" + + /// RDF content-type corresponding to the text/turtle mime-type. + case ttl = "ttl" + + /// Prevent the use of the corresponding http header. + case none = "none" +} + + +/** +The type of contributor + +URL: http://hl7.org/fhir/contributor-type +ValueSet: http://hl7.org/fhir/ValueSet/contributor-type +*/ +public enum ContributorType: String { + + /// An author of the content of the module + case author = "author" + + /// An editor of the content of the module + case editor = "editor" + + /// A reviewer of the content of the module + case reviewer = "reviewer" + + /// An endorser of the content of the module + case endorser = "endorser" +} + + +/** +Copy Number Event + +URL: http://hl7.org/fhir/copy-number-event +ValueSet: http://hl7.org/fhir/ValueSet/copy-number-event +*/ +public enum CopyNumberEvent: String { + + /// amplificaiton + case amp = "amp" + + /// deletion + case del = "del" + + /// loss of function + case lof = "lof" +} + + +/** +A code specifying the state of the resource instance. + +URL: http://hl7.org/fhir/coverage-status +ValueSet: http://hl7.org/fhir/ValueSet/coverage-status +*/ +public enum CoverageStatus: String { + + /// The resource instance is currently in-force. + case active = "active" + + /// The resource instance is withdrawn, rescinded or reversed. + case cancelled = "cancelled" + + /// A new resource instance the contents of which is not complete. + case draft = "draft" + + /// The resource instance was entered in error. + case enteredInError = "entered-in-error" +} + + +/** +The type of the service endpoint + +URL: http://hl7.org/fhir/dWebType +ValueSet: http://hl7.org/fhir/ValueSet/dWebType +*/ +public enum DWebType: String { + + /// Web Access to DICOM Persistent Objects - RESTful Services + case WADORS = "WADO-RS" + + /// Web Access to DICOM Persistent Objects - URI + case WADOURI = "WADO-URI" + + /// IHE - Invoke Image Display Profile + case IID = "IID" +} + + +/** +Used to specify why the normally expected content of the data element is missing. + +URL: http://hl7.org/fhir/data-absent-reason +ValueSet: http://hl7.org/fhir/ValueSet/data-absent-reason +*/ +public enum DataAbsentReason: String { + + /// The value is not known. + case unknown = "unknown" + + /// The source human does not know the value. + case asked = "asked" + + /// There is reason to expect (from the workflow) that the value may become known. + case temp = "temp" + + /// The workflow didn't lead to this value being known. + case notAsked = "not-asked" + + /// The information is not available due to security, privacy or related reasons. + case masked = "masked" + + /// The source system wasn't capable of supporting this element. + case unsupported = "unsupported" + + /// The content of the data is represented in the resource narrative. + case astext = "astext" + + /// Some system or workflow process error means that the information is not available. + case error = "error" + + /// NaN, standing for not a number, is a numeric data type value representing an undefined or unrepresentable value. + case naN = "NaN" + + /// The value is not available because the observation procedure (test, etc.) was not performed. + case notPerformed = "not-performed" +} + + +/** +Indicates the degree of precision of the data element definition. + +URL: http://hl7.org/fhir/dataelement-stringency +ValueSet: http://hl7.org/fhir/ValueSet/dataelement-stringency +*/ +public enum DataElementStringency: String { + + /// The data element is sufficiently well-constrained that multiple pieces of data captured according to the + /// constraints of the data element will be comparable (though in some cases, a degree of automated + /// conversion/normalization may be required). + case comparable = "comparable" + + /// The data element is fully specified down to a single value set, single unit of measure, single data type, etc. + /// Multiple pieces of data associated with this data element are fully comparable. + case fullySpecified = "fully-specified" + + /// The data element allows multiple units of measure having equivalent meaning; e.g. "cc" (cubic centimeter) and + /// "mL" (milliliter). + case equivalent = "equivalent" + + /// The data element allows multiple units of measure that are convertable between each other (e.g. inches and + /// centimeters) and/or allows data to be captured in multiple value sets for which a known mapping exists allowing + /// conversion of meaning. + case convertable = "convertable" + + /// A convertable data element where unit conversions are different only by a power of 10; e.g. g, mg, kg. + case scaleable = "scaleable" + + /// The data element is unconstrained in units, choice of data types and/or choice of vocabulary such that automated + /// comparison of data captured using the data element is not possible. + case flexible = "flexible" +} + + +/** +The type of an element - one of the FHIR data types. + +URL: http://hl7.org/fhir/data-types +ValueSet: http://hl7.org/fhir/ValueSet/data-types +*/ +public enum DataType: String { + + /// An address expressed using postal conventions (as opposed to GPS or other location definition formats). This + /// data type may be used to convey addresses for use in delivering mail as well as for visiting locations and which + /// might not be valid for mail delivery. There are a variety of postal address formats defined around the world. + case address = "Address" + + /// A duration of time during which an organism (or a process) has existed. + case age = "Age" + + /// A text note which also contains information about who made the statement and when. + case annotation = "Annotation" + + /// For referring to data content defined in other formats. + case attachment = "Attachment" + + /// Base definition for all elements that are defined inside a resource - but not those in a data type. + case backboneElement = "BackboneElement" + + /// A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. + case codeableConcept = "CodeableConcept" + + /// A reference to a code defined by a terminology system. + case coding = "Coding" + + /// Specifies contact information for a person or organization. + case contactDetail = "ContactDetail" + + /// Details for all kinds of technology mediated contact points for a person or organization, including telephone, + /// email, etc. + case contactPoint = "ContactPoint" + + /// A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers. + case contributor = "Contributor" + + /// A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts + /// that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + case count = "Count" + + /// Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based + /// filters of the data. + case dataRequirement = "DataRequirement" + + /// A length - a value with a unit that is a physical distance. + case distance = "Distance" + + /// Indicates how the medication is to be used by the patient. + case dosageInstruction = "DosageInstruction" + + /// A length of time. + case duration = "Duration" + + /// Base definition for all elements in a resource. + case element = "Element" + + /// Captures constraints on each element within the resource, profile, or extension. + case elementDefinition = "ElementDefinition" + + /// Optional Extensions Element - found in all resources. + case extension_fhir = "Extension" + + /// A human's name with the ability to identify parts and usage. + case humanName = "HumanName" + + /// A technical identifier - identifies some entity uniquely and unambiguously. + case identifier = "Identifier" + + /// The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes + /// to the content may not always be associated with version changes to the resource. + case meta = "Meta" + + /// An amount of economic utility in some recognised currency. + case money = "Money" + + /// A human-readable formatted text, including images. + case narrative = "Narrative" + + /// The parameters to the module. This collection specifies both the input and output parameters. Input parameters + /// are provided by the caller as part of the $evaluate operation. Output parameters are included in the + /// GuidanceResponse. + case parameterDefinition = "ParameterDefinition" + + /// A time period defined by a start and end date and optionally time. + case period = "Period" + + /// A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts + /// that are not precisely quantified, including amounts involving arbitrary units and floating currencies. + case quantity = "Quantity" + + /// A set of ordered Quantities defined by a low and high limit. + case range = "Range" + + /// A relationship of two Quantity values - expressed as a numerator and a denominator. + case ratio = "Ratio" + + /// A reference from one resource to another. + case reference = "Reference" + + /// Related artifacts such as additional documentation, justification, or bibliographic references. + case relatedArtifact = "RelatedArtifact" + + /// A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in + /// the data. + case sampledData = "SampledData" + + /// A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a + /// graphical image representing a hand-written signature, or a signature process. Different Signature approaches + /// have different utilities. + case signature = "Signature" + + /// simpleQuantity + case simpleQuantity = "SimpleQuantity" + + /// Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected + /// or requested to occur. The most common usage is in dosage instructions for medications. They are also used when + /// planning care of various kinds. + case timing = "Timing" + + /// A description of a triggering event. + case triggerDefinition = "TriggerDefinition" + + /// Specifies clinical/business/etc metadata that can be used to retrieve, index and/or categorize an artifact. This + /// metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context + /// of care (e.g., venue, care setting, provider of care). + case usageContext = "UsageContext" + + /// A stream of bytes + case base64Binary = "base64Binary" + + /// Value of "true" or "false" + case boolean = "boolean" + + /// A string which has at least one character and no leading or trailing whitespace and where there is no whitespace + /// other than single spaces in the contents + case code = "code" + + /// A date or partial date (e.g. just year or year + month). There is no time zone. The format is a union of the + /// schema types gYear, gYearMonth and date. Dates SHALL be valid dates. + case date = "date" + + /// A date, date-time or partial date (e.g. just year or year + month). If hours and minutes are specified, a time + /// zone SHALL be populated. The format is a union of the schema types gYear, gYearMonth, date and dateTime. Seconds + /// must be provided due to schema type constraints but may be zero-filled and may be ignored. Dates + /// SHALL be valid dates. + case dateTime = "dateTime" + + /// A rational number with implicit precision + case decimal = "decimal" + + /// Any combination of letters, numerals, "-" and ".", with a length limit of 64 characters. (This might be an + /// integer, an unprefixed OID, UUID or any other identifier pattern that meets these constraints.) Ids are case- + /// insensitive. + case id = "id" + + /// An instant in time - known at least to the second + case instant = "instant" + + /// A whole number + case integer = "integer" + + /// A string that may contain markdown syntax for optional processing by a mark down presentation engine + case markdown = "markdown" + + /// An oid represented as a URI + case oid = "oid" + + /// An integer with a value that is positive (e.g. >0) + case positiveInt = "positiveInt" + + /// A sequence of Unicode characters + case string = "string" + + /// A time during the day, with no date specified + case time = "time" + + /// An integer with a value that is not negative (e.g. >= 0) + case unsignedInt = "unsignedInt" + + /// String of characters used to identify a name or a resource + case uri = "uri" + + /// A UUID, represented as a URI + case uuid = "uuid" + + /// XHTML format, as defined by W3C, but restricted usage (mainly, no active content) + case xhtml = "xhtml" +} + + +/** +The days of the week. + +URL: http://hl7.org/fhir/days-of-week +ValueSet: http://hl7.org/fhir/ValueSet/days-of-week +*/ +public enum DaysOfWeek: String { + + /// Monday + case mon = "mon" + + /// Tuesday + case tue = "tue" + + /// Wednesday + case wed = "wed" + + /// Thursday + case thu = "thu" + + /// Friday + case fri = "fri" + + /// Saturday + case sat = "sat" + + /// Sunday + case sun = "sun" +} + + +/** +Codes identifying the stage lifecycle stage of a definition + +URL: http://hl7.org/fhir/definition-status +ValueSet: http://hl7.org/fhir/ValueSet/definition-status +*/ +public enum DefinitionStatus: String { + + /// draft + case draft = "draft" + + /// active + case active = "active" + + /// withdrawn + case withdrawn = "withdrawn" +} + + +/** +Indicates the potential degree of impact of the identified issue on the patient. + +URL: http://hl7.org/fhir/detectedissue-severity +ValueSet: http://hl7.org/fhir/ValueSet/detectedissue-severity +*/ +public enum DetectedIssueSeverity: String { + + /// Indicates the issue may be life-threatening or has the potential to cause permanent injury. + case high = "high" + + /// Indicates the issue may result in noticeable adverse consequences but is unlikely to be life-threatening or + /// cause permanent injury. + case moderate = "moderate" + + /// Indicates the issue may result in some adverse consequences but is unlikely to substantially affect the + /// situation of the subject. + case low = "low" +} + + +/** +Describes the state of a metric calibration. + +URL: http://hl7.org/fhir/metric-calibration-state +ValueSet: http://hl7.org/fhir/ValueSet/metric-calibration-state +*/ +public enum DeviceMetricCalibrationState: String { + + /// The metric has not been calibrated. + case notCalibrated = "not-calibrated" + + /// The metric needs to be calibrated. + case calibrationRequired = "calibration-required" + + /// The metric has been calibrated. + case calibrated = "calibrated" + + /// The state of calibration of this metric is unspecified. + case unspecified = "unspecified" +} + + +/** +Describes the type of a metric calibration. + +URL: http://hl7.org/fhir/metric-calibration-type +ValueSet: http://hl7.org/fhir/ValueSet/metric-calibration-type +*/ +public enum DeviceMetricCalibrationType: String { + + /// TODO + case unspecified = "unspecified" + + /// TODO + case offset = "offset" + + /// TODO + case gain = "gain" + + /// TODO + case twoPoint = "two-point" +} + + +/** +Describes the category of the metric. + +URL: http://hl7.org/fhir/metric-category +ValueSet: http://hl7.org/fhir/ValueSet/metric-category +*/ +public enum DeviceMetricCategory: String { + + /// DeviceObservations generated for this DeviceMetric are measured. + case measurement = "measurement" + + /// DeviceObservations generated for this DeviceMetric is a setting that will influence the behavior of the Device. + case setting = "setting" + + /// DeviceObservations generated for this DeviceMetric are calculated. + case calculation = "calculation" + + /// The category of this DeviceMetric is unspecified. + case unspecified = "unspecified" +} + + +/** +Describes the typical color of representation. + +URL: http://hl7.org/fhir/metric-color +ValueSet: http://hl7.org/fhir/ValueSet/metric-color +*/ +public enum DeviceMetricColor: String { + + /// Color for representation - black. + case black = "black" + + /// Color for representation - red. + case red = "red" + + /// Color for representation - green. + case green = "green" + + /// Color for representation - yellow. + case yellow = "yellow" + + /// Color for representation - blue. + case blue = "blue" + + /// Color for representation - magenta. + case magenta = "magenta" + + /// Color for representation - cyan. + case cyan = "cyan" + + /// Color for representation - white. + case white = "white" +} + + +/** +Describes the operational status of the DeviceMetric. + +URL: http://hl7.org/fhir/metric-operational-status +ValueSet: http://hl7.org/fhir/ValueSet/metric-operational-status +*/ +public enum DeviceMetricOperationalStatus: String { + + /// The DeviceMetric is operating and will generate DeviceObservations. + case on = "on" + + /// The DeviceMetric is not operating. + case off = "off" + + /// The DeviceMetric is operating, but will not generate any DeviceObservations. + case standby = "standby" +} + + +/** +The availability status of the device. + +URL: http://hl7.org/fhir/devicestatus +ValueSet: http://hl7.org/fhir/ValueSet/devicestatus +*/ +public enum DeviceStatus: String { + + /// The Device is available for use. + case available = "available" + + /// The Device is no longer available for use (e.g. lost, expired, damaged). + case notAvailable = "not-available" + + /// The Device was entered in error and voided. + case enteredInError = "entered-in-error" +} + + +/** +The status of the diagnostic report as a whole. + +URL: http://hl7.org/fhir/diagnostic-report-status +ValueSet: http://hl7.org/fhir/ValueSet/diagnostic-report-status +*/ +public enum DiagnosticReportStatus: String { + + /// The existence of the report is registered, but there is nothing yet available. + case registered = "registered" + + /// This is a partial (e.g. initial, interim or preliminary) report: data in the report may be incomplete or + /// unverified. + case partial = "partial" + + /// The report is complete and verified by an authorized person. + case final = "final" + + /// The report has been modified subsequent to being Final, and is complete and verified by an authorized person + case corrected = "corrected" + + /// The report has been modified subsequent to being Final, and is complete and verified by an authorized person. + /// New content has been added, but existing content hasn't changed. + case appended = "appended" + + /// The report is unavailable because the measurement was not started or not completed (also sometimes called + /// "aborted"). + case cancelled = "cancelled" + + /// The report has been withdrawn following a previous final release. + case enteredInError = "entered-in-error" +} + + +/** +Whether the Media is a photo, video, or audio + +URL: http://hl7.org/fhir/digital-media-type +ValueSet: http://hl7.org/fhir/ValueSet/digital-media-type +*/ +public enum DigitalMediaType: String { + + /// The media consists of one or more unmoving images, including photographs, computer-generated graphs and charts, + /// and scanned documents + case photo = "photo" + + /// The media consists of a series of frames that capture a moving image + case video = "video" + + /// The media consists of a sound recording + case audio = "audio" +} + + +/** +Whether the application produces or consumes documents. + +URL: http://hl7.org/fhir/document-mode +ValueSet: http://hl7.org/fhir/ValueSet/document-mode +*/ +public enum DocumentMode: String { + + /// The application produces documents of the specified type. + case producer = "producer" + + /// The application consumes documents of the specified type. + case consumer = "consumer" +} + + +/** +The status of the document reference. + +URL: http://hl7.org/fhir/document-reference-status +ValueSet: http://hl7.org/fhir/ValueSet/document-reference-status +*/ +public enum DocumentReferenceStatus: String { + + /// This is the current reference for this document. + case current = "current" + + /// This reference has been superseded by another reference. + case superseded = "superseded" + + /// This reference was created in error. + case enteredInError = "entered-in-error" +} + + +/** +The type of relationship between documents. + +URL: http://hl7.org/fhir/document-relationship-type +ValueSet: http://hl7.org/fhir/ValueSet/document-relationship-type +*/ +public enum DocumentRelationshipType: String { + + /// This document logically replaces or supersedes the target document. + case replaces = "replaces" + + /// This document was generated by transforming the target document (e.g. format or language conversion). + case transforms = "transforms" + + /// This document is a signature of the target document. + case signs = "signs" + + /// This document adds additional information to the target document. + case appends = "appends" +} + + +/** +A code specifying the state of the resource instance. + +URL: http://hl7.org/fhir/eligibilityrequest-status +ValueSet: http://hl7.org/fhir/ValueSet/eligibilityrequest-status +*/ +public enum EligibilityRequestStatus: String { + + /// The resource instance is currently in-force. + case active = "active" + + /// The resource instance is withdrawn, rescinded or reversed. + case cancelled = "cancelled" + + /// A new resource instance the contents of which is not complete. + case draft = "draft" + + /// The resource instance was entered in error. + case enteredInError = "entered-in-error" +} + + +/** +A code specifying the state of the resource instance. + +URL: http://hl7.org/fhir/eligibilityresponse-status +ValueSet: http://hl7.org/fhir/ValueSet/eligibilityresponse-status +*/ +public enum EligibilityResponseStatus: String { + + /// The resource instance is currently in-force. + case active = "active" + + /// The resource instance is withdrawn, rescinded or reversed. + case cancelled = "cancelled" + + /// A new resource instance the contents of which is not complete. + case draft = "draft" + + /// The resource instance was entered in error. + case enteredInError = "entered-in-error" +} + + +/** +The status of the location. + +URL: http://hl7.org/fhir/encounter-location-status +ValueSet: http://hl7.org/fhir/ValueSet/encounter-location-status +*/ +public enum EncounterLocationStatus: String { + + /// The patient is planned to be moved to this location at some point in the future. + case planned = "planned" + + /// The patient is currently at this location, or was between the period specified. + /// + /// A system may update these records when the patient leaves the location to either reserved, or completed + case active = "active" + + /// This location is held empty for this patient. + case reserved = "reserved" + + /// The patient was at this location during the period specified. + /// + /// Not to be used when the patient is currently at the location + case completed = "completed" +} + + +/** +Current state of the encounter + +URL: http://hl7.org/fhir/encounter-status +ValueSet: http://hl7.org/fhir/ValueSet/encounter-status +*/ +public enum EncounterStatus: String { + + /// The Encounter has not yet started. + case planned = "planned" + + /// The Patient is present for the encounter, however is not currently meeting with a practitioner. + case arrived = "arrived" + + /// The Encounter has begun and the patient is present / the practitioner and the patient are meeting. + case inProgress = "in-progress" + + /// The Encounter has begun, but the patient is temporarily on leave. + case onleave = "onleave" + + /// The Encounter has ended. + case finished = "finished" + + /// The Encounter has ended before it has begun. + case cancelled = "cancelled" + + /// This instance should not have been part of this patient's medical record. + case enteredInError = "entered-in-error" +} + + +/** +The status of the encounter. + +URL: http://hl7.org/fhir/endpoint-status +ValueSet: http://hl7.org/fhir/ValueSet/endpoint-status +*/ +public enum EndpointStatus: String { + + /// This endpoint is expected to be active and can be used + case active = "active" + + /// This endpoint is temporarily unavailable + case suspended = "suspended" + + /// This endpoint has exceeded connectivity thresholds and is considered in an error state and should no longer be + /// attempted to connect to until corrective action is taken + case error = "error" + + /// This endpoint is no longer to be used + case off = "off" + + /// This instance should not have been part of this patient's medical record. + case enteredInError = "entered-in-error" + + /// This endpoint is not intended for production usage. + case test = "test" +} + + +/** +A code specifying the state of the resource instance. + +URL: http://hl7.org/fhir/enrollmentrequest-status +ValueSet: http://hl7.org/fhir/ValueSet/enrollmentrequest-status +*/ +public enum EnrollmentRequestStatus: String { + + /// The resource instance is currently in-force. + case active = "active" + + /// The resource instance is withdrawn, rescinded or reversed. + case cancelled = "cancelled" + + /// A new resource instance the contents of which is not complete. + case draft = "draft" + + /// The resource instance was entered in error. + case enteredInError = "entered-in-error" +} + + +/** +A code specifying the state of the resource instance. + +URL: http://hl7.org/fhir/enrollmentresponse-status +ValueSet: http://hl7.org/fhir/ValueSet/enrollmentresponse-status +*/ +public enum EnrollmentResponseStatus: String { + + /// The resource instance is currently in-force. + case active = "active" + + /// The resource instance is withdrawn, rescinded or reversed. + case cancelled = "cancelled" + + /// A new resource instance the contents of which is not complete. + case draft = "draft" + + /// The resource instance was entered in error. + case enteredInError = "entered-in-error" +} + + +/** +The status of the episode of care. + +URL: http://hl7.org/fhir/episode-of-care-status +ValueSet: http://hl7.org/fhir/ValueSet/episode-of-care-status +*/ +public enum EpisodeOfCareStatus: String { + + /// This episode of care is planned to start at the date specified in the period.start. During this status an + /// organization may perform assessments to determine if they are eligible to receive services, or be organizing to + /// make resources available to provide care services. + case planned = "planned" + + /// This episode has been placed on a waitlist, pending the episode being made active (or cancelled). + case waitlist = "waitlist" + + /// This episode of care is current. + case active = "active" + + /// This episode of care is on hold, the organization has limited responsibility for the patient (such as while on + /// respite). + case onhold = "onhold" + + /// This episode of care is finished at the organization is not expecting to be providing care to the patient. Can + /// also be known as "closed", "completed" or other similar terms. + case finished = "finished" + + /// The episode of care was cancelled, or withdrawn from service, often selected during the planned stage as the + /// patient may have gone elsewhere, or the circumstances have changed and the organization is unable to provide the + /// care. It indicates that services terminated outside the planned/expected workflow. + case cancelled = "cancelled" + + /// This instance should not have been part of this patient's medical record. + case enteredInError = "entered-in-error" +} + + +/** +The mode of a message capability statement. + +URL: http://hl7.org/fhir/event-capability-mode +ValueSet: http://hl7.org/fhir/ValueSet/event-capability-mode +*/ +public enum EventCapabilityMode: String { + + /// The application sends requests and receives responses. + case sender = "sender" + + /// The application receives requests and sends responses. + case receiver = "receiver" +} + + +/** +Codes identifying the stage lifecycle stage of a event + +URL: http://hl7.org/fhir/event-status +ValueSet: http://hl7.org/fhir/ValueSet/event-status +*/ +public enum EventStatus: String { + + /// The core event has not started yet, but some staging activities have begun (e.g. surgical suite preparation). + /// Preparation stages may be tracked for billing purposes. + case preparation = "preparation" + + /// The event is currently occurring + case inProgress = "in-progress" + + /// The event has been temporarily stopped but is expected to resume in the future + case suspended = "suspended" + + /// The event was prior to the full completion of the intended actions + case aborted = "aborted" + + /// The event has now concluded + case completed = "completed" + + /// This electronic record should never have existed, though it is possible that real-world decisions were based on + /// it. (If real-world activity has occurred, the status should be "cancelled" rather than "entered-in-error".) + case enteredInError = "entered-in-error" +} + + +/** +A code specifying the state of the resource instance. + +URL: http://hl7.org/fhir/explanationofbenefit-status +ValueSet: http://hl7.org/fhir/ValueSet/explanationofbenefit-status +*/ +public enum ExplanationOfBenefitStatus: String { + + /// The resource instance is currently in-force. + case active = "active" + + /// The resource instance is withdrawn, rescinded or reversed. + case cancelled = "cancelled" + + /// A new resource instance the contents of which is not complete. + case draft = "draft" + + /// The resource instance was entered in error. + case enteredInError = "entered-in-error" +} + + +/** +How an extension context is interpreted. + +URL: http://hl7.org/fhir/extension-context +ValueSet: http://hl7.org/fhir/ValueSet/extension-context +*/ +public enum ExtensionContext: String { + + /// The context is all elements matching a particular resource element path. + case resource = "resource" + + /// The context is all nodes matching a particular data type element path (root or repeating element) or all + /// elements referencing a particular primitive data type (expressed as the datatype name). + case datatype = "datatype" + + /// The context is a particular extension from a particular profile, a uri that identifies the extension definition. + case extension_fhir = "extension" +} + + +/** +A set of common concept properties for use on coded systems through out the FHIR eco-system. + +URL: http://hl7.org/fhir/concept-properties +ValueSet: http://hl7.org/fhir/ValueSet/concept-properties +*/ +public enum FHIRDefinedConceptProperties: String { + + /// True if the concept is not considered active - e.g. not a valid concept any more. Property type is boolean, + /// default value is false + case inactive = "inactive" + + /// The date at which a concept was deprecated. Concepts that are deprecated but not inactive can still be used, but + /// their use is discouraged, and they should be expected to be made inactive in a future release. Property type is + /// dateTime + case deprecated = "deprecated" + + /// The concept is not intended to be chosen by the user - only intended to be used as a selector for other + /// concepts. Note, though, that the interpretation of this is highly contextual; all concepts are selectable in + /// some context. Property type is boolean, default value is false + case notSelectable = "notSelectable" + + /// The concept identified in this property is a parent of the concept on which it is a property. The property type + /// will be 'code'. The meaning of 'parent' is defined by the heirarchyMeaning attribute + case parent = "parent" + + /// The concept identified in this property is a child of the concept on which it is a property. The property type + /// will be 'code'. The meaning of 'child' is defined by the heirarchyMeaning attribute + case child = "child" +} + + +/** +The set of interactions defined by the RESTful part of the FHIR specification. + +URL: http://hl7.org/fhir/restful-interaction +ValueSet: http://hl7.org/fhir/ValueSet/restful-interaction +*/ +public enum FHIRRestfulInteractions: String { + + /// Read the current state of the resource. + case read = "read" + + /// Read the state of a specific version of the resource. + case vread = "vread" + + /// Update an existing resource by its id (or create it if it is new). + case update = "update" + + /// Delete a resource. + case delete = "delete" + + /// Retrieve the change history for a particular resource, type of resource, or the entire system. + case history = "history" + + /// Retrieve the change history for a particular resource. + case historyInstance = "history-instance" + + /// Retrieve the change history for a all resources of a particular type. + case historyType = "history-type" + + /// Retrieve the change history for all resources on a system. + case historySystem = "history-system" + + /// Create a new resource with a server assigned id. + case create = "create" + + /// Search a resource type or all resources based on some filter criteria. + case search = "search" + + /// Search all resources of the specified type based on some filter criteria. + case searchType = "search-type" + + /// Search all resources based on some filter criteria. + case searchSystem = "search-system" + + /// Get a Capability Statement for the system. + case capabilities = "capabilities" + + /// Update, create or delete a set of resources as a single transaction. + case transaction = "transaction" + + /// perform a set of a separate interactions in a single http operation + case batch = "batch" + + /// Perform an operation as defined by an OperationDefinition. + case operation = "operation" +} + + +/** +A code that identifies the status of the family history record. + +URL: http://hl7.org/fhir/history-status +ValueSet: http://hl7.org/fhir/ValueSet/history-status +*/ +public enum FamilyHistoryStatus: String { + + /// Some health information is known and captured, but not complete - see notes for details. + case partial = "partial" + + /// All available related health information is captured as of the date (and possibly time) when the family member + /// history was taken. + case completed = "completed" + + /// This instance should not have been part of this patient's medical record. + case enteredInError = "entered-in-error" + + /// Health information for this individual is unavailable/unknown. + case healthUnknown = "health-unknown" +} + + +/** +The kind of operation to perform as a part of a property based filter. + +URL: http://hl7.org/fhir/filter-operator +ValueSet: http://hl7.org/fhir/ValueSet/filter-operator +*/ +public enum FilterOperator: String { + + /// The specified property of the code equals the provided value. + case eq = "=" + + /// Includes all concept ids that have a transitive is-a relationship with the concept Id provided as the value, + /// including the provided concept itself (i.e. include child codes) + case isA = "is-a" + + /// The specified property of the code does not have an is-a relationship with the provided value. + case isNotA = "is-not-a" + + /// The specified property of the code matches the regex specified in the provided value. + case regex = "regex" + + /// The specified property of the code is in the set of codes or concepts specified in the provided value (comma + /// separated list). + case `in` = "in" + + /// The specified property of the code is not in the set of codes or concepts specified in the provided value (comma + /// separated list). + case notIn = "not-in" + + /// Includes all concept ids that have a transitive is-a relationship from the concept Id provided as the value, + /// including the provided concept itself (e.g. include parent codes) + case generalizes = "generalizes" +} + + +/** +Indicates whether this flag is active and needs to be displayed to a user, or whether it is no longer needed or entered +in error. + +URL: http://hl7.org/fhir/flag-status +ValueSet: http://hl7.org/fhir/ValueSet/flag-status +*/ +public enum FlagStatus: String { + + /// A current flag that should be displayed to a user. A system may use the category to determine which roles should + /// view the flag. + case active = "active" + + /// The flag does not need to be displayed any more. + case inactive = "inactive" + + /// The flag was added in error, and should no longer be displayed. + case enteredInError = "entered-in-error" +} + + +/** +Codes indicating whether the goal has been accepted by a stakeholder + +URL: http://hl7.org/fhir/goal-acceptance-status +ValueSet: http://hl7.org/fhir/ValueSet/goal-acceptance-status +*/ +public enum GoalAcceptanceStatus: String { + + /// Stakeholder supports pursuit of the goal + case agree = "agree" + + /// Stakeholder is not in support of the pursuit of the goal + case disagree = "disagree" + + /// Stakeholder has not yet made a decision on whether they support the goal + case pending = "pending" +} + + +/** +Types of relationships between two goals + +URL: http://hl7.org/fhir/goal-relationship-type +ValueSet: http://hl7.org/fhir/ValueSet/goal-relationship-type +*/ +public enum GoalRelationshipType: String { + + /// Indicates that the target goal is one which must be met before striving for the current goal + case predecessor = "predecessor" + + /// Indicates that the target goal is a desired objective once the current goal is met + case successor = "successor" + + /// Indicates that this goal has been replaced by the target goal + case replacement = "replacement" + + /// Indicates that the target goal is considered to be a "piece" of attaining this goal. + case component = "component" + + /// Indicates that the relationship is not covered by one of the pre-defined codes. (An extension may convey more + /// information about the meaning of the relationship.) + case other = "other" +} + + +/** +Indicates whether the goal has been met and is still being targeted + +URL: http://hl7.org/fhir/goal-status +ValueSet: http://hl7.org/fhir/ValueSet/goal-status +*/ +public enum GoalStatus: String { + + /// A goal is proposed for this patient + case proposed = "proposed" + + /// A goal is planned for this patient + case planned = "planned" + + /// A proposed goal was accepted + case accepted = "accepted" + + /// A proposed goal was rejected + case rejected = "rejected" + + /// The goal is being sought but has not yet been reached. (Also applies if goal was reached in the past but there + /// has been regression and goal is being sought again) + case inProgress = "in-progress" + + /// The goal has been met and no further action is needed + case achieved = "achieved" + + /// The goal has been met, but ongoing activity is needed to sustain the goal objective + case sustaining = "sustaining" + + /// The goal remains a long term objective but is no longer being actively pursued for a temporary period of time. + case onHold = "on-hold" + + /// The goal is no longer being sought + case cancelled = "cancelled" + + /// The goal is on scheduled for the planned timelines + case onTarget = "on-target" + + /// The goal is ahead of the planned timelines + case aheadOfTarget = "ahead-of-target" + + /// The goal is behind the planned timelines + case behindTarget = "behind-target" + + /// The goal was entered in error and voided. + case enteredInError = "entered-in-error" +} + + +/** +Types of resources that are part of group + +URL: http://hl7.org/fhir/group-type +ValueSet: http://hl7.org/fhir/ValueSet/group-type +*/ +public enum GroupType: String { + + /// Group contains "person" Patient resources + case person = "person" + + /// Group contains "animal" Patient resources + case animal = "animal" + + /// Group contains healthcare practitioner resources + case practitioner = "practitioner" + + /// Group contains Device resources + case device = "device" + + /// Group contains Medication resources + case medication = "medication" + + /// Group contains Substance resources + case substance = "substance" +} + + +/** +The status of a guidance response + +URL: http://hl7.org/fhir/guidance-response-status +ValueSet: http://hl7.org/fhir/ValueSet/guidance-response-status +*/ +public enum GuidanceResponseStatus: String { + + /// The request was processed successfully + case success = "success" + + /// The request was processed successfully, but more data may result in a more complete evaluation + case dataRequested = "data-requested" + + /// The request was processed, but more data is required to complete the evaluation + case dataRequired = "data-required" + + /// The request is currently being processed + case inProgress = "in-progress" + + /// The request was not processed successfully + case failure = "failure" +} + + +/** +How a dependency is represented when the guide is published. + +URL: http://hl7.org/fhir/guide-dependency-type +ValueSet: http://hl7.org/fhir/ValueSet/guide-dependency-type +*/ +public enum GuideDependencyType: String { + + /// The guide is referred to by URL. + case reference = "reference" + + /// The guide is embedded in this guide when published. + case inclusion = "inclusion" +} + + +/** +The kind of an included page. + +URL: http://hl7.org/fhir/guide-page-kind +ValueSet: http://hl7.org/fhir/ValueSet/guide-page-kind +*/ +public enum GuidePageKind: String { + + /// This is a page of content that is included in the implementation guide. It has no particular function. + case page = "page" + + /// This is a page that represents a human readable rendering of an example. + case example = "example" + + /// This is a page that represents a list of resources of one or more types. + case list = "list" + + /// This is a page showing where an included guide is injected. + case include = "include" + + /// This is a page that lists the resources of a given type, and also creates pages for all the listed types as + /// other pages in the section. + case directory = "directory" + + /// This is a page that creates the listed resources as a dictionary. + case dictionary = "dictionary" + + /// This is a generated page that contains the table of contents. + case toc = "toc" + + /// This is a page that represents a presented resource. This is typically used for generated conformance resource + /// presentations. + case resource = "resource" +} + + +/** +HTTP verbs (in the HTTP command line). + +URL: http://hl7.org/fhir/http-verb +ValueSet: http://hl7.org/fhir/ValueSet/http-verb +*/ +public enum HTTPVerb: String { + + /// HTTP GET + case GET = "GET" + + /// HTTP POST + case POST = "POST" + + /// HTTP PUT + case PUT = "PUT" + + /// HTTP DELETE + case DELETE = "DELETE" +} + + +/** +Identifies the purpose for this identifier, if known . + +URL: http://hl7.org/fhir/identifier-use +ValueSet: http://hl7.org/fhir/ValueSet/identifier-use +*/ +public enum IdentifierUse: String { + + /// The identifier recommended for display and use in real-world interactions. + case usual = "usual" + + /// The identifier considered to be most trusted for the identification of this item. + case official = "official" + + /// A temporary identifier. + case temp = "temp" + + /// An identifier that was assigned in secondary use - it serves to identify the object in a relative context, but + /// cannot be consistently assigned to the same object again in a different context. + case secondary = "secondary" +} + + +/** +The level of confidence that this link represents the same actual person, based on NIST Authentication Levels. + +URL: http://hl7.org/fhir/identity-assuranceLevel +ValueSet: http://hl7.org/fhir/ValueSet/identity-assuranceLevel +*/ +public enum IdentityAssuranceLevel: String { + + /// Little or no confidence in the asserted identity's accuracy. + case level1 = "level1" + + /// Some confidence in the asserted identity's accuracy. + case level2 = "level2" + + /// High confidence in the asserted identity's accuracy. + case level3 = "level3" + + /// Very high confidence in the asserted identity's accuracy. + case level4 = "level4" +} + + +/** +How the issue affects the success of the action. + +URL: http://hl7.org/fhir/issue-severity +ValueSet: http://hl7.org/fhir/ValueSet/issue-severity +*/ +public enum IssueSeverity: String { + + /// The issue caused the action to fail, and no further checking could be performed. + case fatal = "fatal" + + /// The issue is sufficiently important to cause the action to fail. + case error = "error" + + /// The issue is not important enough to cause the action to fail, but may cause it to be performed suboptimally or + /// in a way that is not as desired. + case warning = "warning" + + /// The issue has no relation to the degree of success of the action. + case information = "information" +} + + +/** +A code that describes the type of issue. + +URL: http://hl7.org/fhir/issue-type +ValueSet: http://hl7.org/fhir/ValueSet/issue-type +*/ +public enum IssueType: String { + + /// Content invalid against the specification or a profile. + case invalid = "invalid" + + /// A structural issue in the content such as wrong namespace, or unable to parse the content completely, or invalid + /// json syntax. + case structure = "structure" + + /// A required element is missing. + case required = "required" + + /// An element value is invalid. + case value = "value" + + /// A content validation rule failed - e.g. a schematron rule. + case invariant = "invariant" + + /// An authentication/authorization/permissions issue of some kind. + case security = "security" + + /// The client needs to initiate an authentication process. + case login = "login" + + /// The user or system was not able to be authenticated (either there is no process, or the proferred token is + /// unacceptable). + case unknown = "unknown" + + /// User session expired; a login may be required. + case expired = "expired" + + /// The user does not have the rights to perform this action. + case forbidden = "forbidden" + + /// Some information was not or may not have been returned due to business rules, consent or privacy rules, or + /// access permission constraints. This information may be accessible through alternate processes. + case suppressed = "suppressed" + + /// Processing issues. These are expected to be final e.g. there is no point resubmitting the same content + /// unchanged. + case processing = "processing" + + /// The resource or profile is not supported. + case notSupported = "not-supported" + + /// An attempt was made to create a duplicate record. + case duplicate = "duplicate" + + /// The reference provided was not found. In a pure RESTful environment, this would be an HTTP 404 error, but this + /// code may be used where the content is not found further into the application architecture. + case notFound = "not-found" + + /// Provided content is too long (typically, this is a denial of service protection type of error). + case tooLong = "too-long" + + /// The code or system could not be understood, or it was not valid in the context of a particular ValueSet.code. + case codeInvalid = "code-invalid" + + /// An extension was found that was not acceptable, could not be resolved, or a modifierExtension was not + /// recognized. + case extension_fhir = "extension" + + /// The operation was stopped to protect server resources; e.g. a request for a value set expansion on all of SNOMED + /// CT. + case tooCostly = "too-costly" + + /// The content/operation failed to pass some business rule, and so could not proceed. + case businessRule = "business-rule" + + /// Content could not be accepted because of an edit conflict (i.e. version aware updates) (In a pure RESTful + /// environment, this would be an HTTP 404 error, but this code may be used where the conflict is discovered further + /// into the application architecture.) + case conflict = "conflict" + + /// Not all data sources typically accessed could be reached, or responded in time, so the returned information may + /// not be complete. + case incomplete = "incomplete" + + /// Transient processing issues. The system receiving the error may be able to resubmit the same content once an + /// underlying issue is resolved. + case transient = "transient" + + /// A resource/record locking failure (usually in an underlying database). + case lockError = "lock-error" + + /// The persistent store is unavailable; e.g. the database is down for maintenance or similar action. + case noStore = "no-store" + + /// An unexpected internal error has occurred. + case exception = "exception" + + /// An internal timeout has occurred. + case timeout = "timeout" + + /// The system is not prepared to handle this request due to load management. + case throttled = "throttled" + + /// A message unrelated to the processing success of the completed operation (examples of the latter include things + /// like reminders of password expiry, system maintenance times, etc.). + case informational = "informational" +} + + +/** +LOINC answer list for Genomic source class + +URL: http://hl7.org/fhir/LOINC-48002-0-answerlist +ValueSet: http://hl7.org/fhir/ValueSet/LOINC-48002-0-answerlist +*/ +public enum LOINC480020Answerlist: String { + + /// Germline + case LA66832 = "LA6683-2" + + /// Somatic + case LA66840 = "LA6684-0" + + /// Prenatal + case LA104291 = "LA10429-1" + + /// Likely Germline + case LA181943 = "LA18194-3" + + /// Likely Somatic + case LA181950 = "LA18195-0" + + /// Likely Prenatal + case LA181968 = "LA18196-8" + + /// Unknown Genomic Origin + case LA181976 = "LA18197-6" +} + + +/** +LOINC answer list for Type of variation + +URL: http://hl7.org/fhir/LOINC-48019-4-answerlist +ValueSet: http://hl7.org/fhir/ValueSet/LOINC-48019-4-answerlist +*/ +public enum LOINC480194Answerlist: String { + + /// Wild type + case LA96581 = "LA9658-1" + + /// Deletion + case LA66923 = "LA6692-3" + + /// Duplication + case LA66865 = "LA6686-5" + + /// Insertion + case LA66873 = "LA6687-3" + + /// Insertion/Deletion + case LA66881 = "LA6688-1" + + /// Inversion + case LA66899 = "LA6689-9" + + /// Substitution + case LA66907 = "LA6690-7" +} + + +/** +LOINC answer list for AllelicState + +URL: http://hl7.org/fhir/LOINC-53034-5-answerlist +ValueSet: http://hl7.org/fhir/ValueSet/LOINC-53034-5-answerlist +*/ +public enum LOINC530345Answerlist: String { + + /// Heteroplasmic + case LA67038 = "LA6703-8" + + /// Homoplasmic + case LA67046 = "LA6704-6" + + /// Homozygous + case LA67053 = "LA6705-3" + + /// Heterozygous + case LA67061 = "LA6706-1" + + /// Hemizygous + case LA67079 = "LA6707-9" +} + + +/** +The type of knowledge asset this library contains + +URL: http://hl7.org/fhir/library-type +ValueSet: http://hl7.org/fhir/ValueSet/library-type +*/ +public enum LibraryType: String { + + /// The resource is a shareable library of formalized knowledge + case logicLibrary = "logic-library" + + /// The resource is a definition of an information model + case modelDefinition = "model-definition" + + /// The resource is a collection of knowledge assets + case assetCollection = "asset-collection" + + /// The resource defines the dependencies, parameters, and data requirements for a particular module or evaluation + /// context + case moduleDefinition = "module-definition" +} + + +/** +The type of link between this patient resource and another patient resource. + +URL: http://hl7.org/fhir/link-type +ValueSet: http://hl7.org/fhir/ValueSet/link-type +*/ +public enum LinkType: String { + + /// The patient resource containing this link must no longer be used. The link points forward to another patient + /// resource that must be used in lieu of the patient resource that contains this link. + case replace = "replace" + + /// The patient resource containing this link is in use and valid but not considered the main source of information + /// about a patient. The link points forward to another patient resource that should be consulted to retrieve + /// additional patient information. + case refer = "refer" + + /// The patient resource containing this link is in use and valid, but points to another patient resource that is + /// known to contain data about the same person. Data in this resource might overlap or contradict information found + /// in the other patient resource. This link does not indicate any relative importance of the resources concerned, + /// and both should be regarded as equally valid. + case seealso = "seealso" +} + + +/** +Used to distinguish different roles a resource can play within a set of linked resources + +URL: http://hl7.org/fhir/linkage-type +ValueSet: http://hl7.org/fhir/ValueSet/linkage-type +*/ +public enum LinkageType: String { + + /// The record represents the "source of truth" (from the perspective of this Linkage resource) for the underlying + /// event/condition/etc. + case source = "source" + + /// The record represents the alternative view of the underlying event/condition/etc. The record may still be + /// actively maintained, even though it is not considered to be the source of truth. + case alternate = "alternate" + + /// The record represents an obsolete record of the underlyng event/condition/etc. It is not expected to be + /// actively maintained. + case historical = "historical" +} + + +/** +The processing mode that applies to this list + +URL: http://hl7.org/fhir/list-mode +ValueSet: http://hl7.org/fhir/ValueSet/list-mode +*/ +public enum ListMode: String { + + /// This list is the master list, maintained in an ongoing fashion with regular updates as the real world list it is + /// tracking changes + case working = "working" + + /// This list was prepared as a snapshot. It should not be assumed to be current + case snapshot = "snapshot" + + /// A list that indicates where changes have been made or recommended + case changes = "changes" +} + + +/** +The current state of the list + +URL: http://hl7.org/fhir/list-status +ValueSet: http://hl7.org/fhir/ValueSet/list-status +*/ +public enum ListStatus: String { + + /// The list is considered to be an active part of the patient's record. + case current = "current" + + /// The list is "old" and should no longer be considered accurate or relevant. + case retired = "retired" + + /// The list was never accurate. It is retained for medico-legal purposes only. + case enteredInError = "entered-in-error" +} + + +/** +Indicates whether a resource instance represents a specific location or a class of locations. + +URL: http://hl7.org/fhir/location-mode +ValueSet: http://hl7.org/fhir/ValueSet/location-mode +*/ +public enum LocationMode: String { + + /// The Location resource represents a specific instance of a location (e.g. Operating Theatre 1A). + case instance = "instance" + + /// The Location represents a class of locations (e.g. Any Operating Theatre) although this class of locations could + /// be constrained within a specific boundary (such as organization, or parent location, address etc.). + case kind = "kind" +} + + +/** +Indicates whether the location is still in use. + +URL: http://hl7.org/fhir/location-status +ValueSet: http://hl7.org/fhir/ValueSet/location-status +*/ +public enum LocationStatus: String { + + /// The location is operational. + case active = "active" + + /// The location is temporarily closed. + case suspended = "suspended" + + /// The location is no longer used. + case inactive = "inactive" +} + + +/** +A Master Patient Index (MPI) assessment of whether a candidate patient record is a match or not. + +URL: http://hl7.org/fhir/patient-mpi-match +ValueSet: http://hl7.org/fhir/ValueSet/patient-mpi-match +*/ +public enum MPIMatch: String { + + /// This record meets the MPI criteria to be automatically considered as a full match. + case certain = "certain" + + /// This record is a close match, but not a certain match. Additional review (e.g. by a human) may be required + /// before using this as a match. + case probable = "probable" + + /// This record may be a matching one. Additional review (e.g. by a human) SHOULD be performed before using this as + /// a match. + case possible = "possible" + + /// This record is known not to be a match. Note that usually non-matching records are not returned, but in some + /// cases records previously or likely considered as a match may specifically be negated by the MPI. + case certainlyNot = "certainly-not" +} + + +/** +A Master Patient Index (MPI) assessment of whether a candidate patient record is a match or not. + +URL: http://hl7.org/fhir/match-grade +ValueSet: http://hl7.org/fhir/ValueSet/match-grade +*/ +public enum MatchGrade: String { + + /// This record meets the matching criteria to be automatically considered as a full match. + case certain = "certain" + + /// This record is a close match, but not a certain match. Additional review (e.g. by a human) may be required + /// before using this as a match. + case probable = "probable" + + /// This record may be a matching one. Additional review (e.g. by a human) SHOULD be performed before using this as + /// a match. + case possible = "possible" + + /// This record is known not to be a match. Note that usually non-matching records are not returned, but in some + /// cases records previously or likely considered as a match may specifically be negated by the matching engine + case certainlyNot = "certainly-not" +} + + +/** +Flags an element as having unlimited repetitions + +URL: http://hl7.org/fhir/question-max-occurs +ValueSet: http://hl7.org/fhir/ValueSet/question-max-occurs +*/ +public enum MaxOccurs: String { + + /// Element can repeat an unlimited number of times + case max = "*" +} + + +/** +Different measurement principle supported by the device. + +URL: http://hl7.org/fhir/measurement-principle +ValueSet: http://hl7.org/fhir/ValueSet/measurement-principle +*/ +public enum MeasmntPrinciple: String { + + /// Measurement principle isn't in the list. + case other = "other" + + /// Measurement is done using the chemical principle. + case chemical = "chemical" + + /// Measurement is done using the electrical principle. + case electrical = "electrical" + + /// Measurement is done using the impedance principle. + case impedance = "impedance" + + /// Measurement is done using the nuclear principle. + case nuclear = "nuclear" + + /// Measurement is done using the optical principle. + case optical = "optical" + + /// Measurement is done using the thermal principle. + case thermal = "thermal" + + /// Measurement is done using the biological principle. + case biological = "biological" + + /// Measurement is done using the mechanical principle. + case mechanical = "mechanical" + + /// Measurement is done using the acoustical principle. + case acoustical = "acoustical" + + /// Measurement is done using the manual principle. + case manual = "manual" +} + + +/** +The intended usage for supplemental data elements in the measure + +URL: http://hl7.org/fhir/measure-data-usage +ValueSet: http://hl7.org/fhir/ValueSet/measure-data-usage +*/ +public enum MeasureDataUsage: String { + + /// The data is intended to be provided as additional information alongside the measure results + case supplementalData = "supplemental-data" + + /// The data is intended to be used to calculate and apply a risk adjustment model for the measure + case riskAdjustmentFactor = "risk-adjustment-factor" +} + + +/** +The type of population + +URL: http://hl7.org/fhir/measure-population +ValueSet: http://hl7.org/fhir/ValueSet/measure-population +*/ +public enum MeasurePopulationType: String { + + /// The initial population for the measure + case initialPopulation = "initial-population" + + /// The numerator for the measure + case numerator = "numerator" + + /// The numerator exclusion for the measure + case numeratorExclusion = "numerator-exclusion" + + /// The denominator for the measure + case denominator = "denominator" + + /// The denominator exclusion for the measure + case denominatorExclusion = "denominator-exclusion" + + /// The denominator exception for the measure + case denominatorException = "denominator-exception" + + /// The measure population for the measure + case measurePopulation = "measure-population" + + /// The measure population exclusion for the measure + case measurePopulationExclusion = "measure-population-exclusion" + + /// The measure observation for the measure + case measureObservation = "measure-observation" +} + + +/** +The status of the measure report + +URL: http://hl7.org/fhir/measure-report-status +ValueSet: http://hl7.org/fhir/ValueSet/measure-report-status +*/ +public enum MeasureReportStatus: String { + + /// The report is complete and ready for use + case complete = "complete" + + /// The report is currently being generated + case pending = "pending" + + /// An error occurred attempting to generate the report + case error = "error" +} + + +/** +The type of the measure report + +URL: http://hl7.org/fhir/measure-report-type +ValueSet: http://hl7.org/fhir/ValueSet/measure-report-type +*/ +public enum MeasureReportType: String { + + /// An individual report that provides information on the performance for a given measure with respect to a single + /// patient + case individual = "individual" + + /// A patient list report that includes a listing of patients that satisfied each population criteria in the measure + case patientList = "patient-list" + + /// A summary report that returns the number of patients in each population criteria for the measure + case summary = "summary" +} + + +/** +The scoring type of the measure + +URL: http://hl7.org/fhir/measure-scoring +ValueSet: http://hl7.org/fhir/ValueSet/measure-scoring +*/ +public enum MeasureScoring: String { + + /// The measure score is defined using a proportion + case proportion = "proportion" + + /// The measure score is defined using a ratio + case ratio = "ratio" + + /// The score is defined by a calculation of some quantity + case continuousVariable = "continuous-variable" + + /// The measure is a cohort definition + case cohort = "cohort" +} + + +/** +The type of measure + +URL: http://hl7.org/fhir/measure-type +ValueSet: http://hl7.org/fhir/ValueSet/measure-type +*/ +public enum MeasureType: String { + + /// The measure is a process measure + case process = "process" + + /// The measure is an outcome measure + case outcome = "outcome" +} + + +/** +A set of codes indicating the current status of a MedicationAdministration. + +URL: http://hl7.org/fhir/medication-admin-status +ValueSet: http://hl7.org/fhir/ValueSet/medication-admin-status +*/ +public enum MedicationAdministrationStatus: String { + + /// The administration has started but has not yet completed. + case inProgress = "in-progress" + + /// Actions implied by the administration have been temporarily halted, but are expected to continue later. May also + /// be called "suspended". + case onHold = "on-hold" + + /// All actions that are implied by the administration have occurred. + case completed = "completed" + + /// The administration was entered in error and therefore nullified. + case enteredInError = "entered-in-error" + + /// Actions implied by the administration have been permanently halted, before all of them occurred. + case stopped = "stopped" +} + + +/** +A coded concept specifying the state of the dispense event. + +URL: http://hl7.org/fhir/medication-dispense-status +ValueSet: http://hl7.org/fhir/ValueSet/medication-dispense-status +*/ +public enum MedicationDispenseStatus: String { + + /// The dispense has started but has not yet completed. + case inProgress = "in-progress" + + /// Actions implied by the administration have been temporarily halted, but are expected to continue later. May also + /// be called "suspended" + case onHold = "on-hold" + + /// All actions that are implied by the dispense have occurred. + case completed = "completed" + + /// The dispense was entered in error and therefore nullified. + case enteredInError = "entered-in-error" + + /// Actions implied by the dispense have been permanently halted, before all of them occurred. + case stopped = "stopped" +} + + +/** +A coded concept identifying where the medication ordered is expected to be consumed or administered + +URL: http://hl7.org/fhir/medication-request-category +ValueSet: http://hl7.org/fhir/ValueSet/medication-request-category +*/ +public enum MedicationRequestCategory: String { + + /// Includes orders for medications to be administered or consumed in an inpatient or acute care setting + case inpatient = "inpatient" + + /// Includes orders for medications to be administered or consumed in an outpatient setting (for example, Emergency + /// Department, Outpatient Clinic, Outpatient Surgery, Doctor's office) + case outpatient = "outpatient" + + /// Includes orders for medications to be administered or consumed by the patient in their home (this would include + /// long term care or nursing homes, hospices, etc) + case community = "community" +} + + +/** +A coded concept specifying the state of the prescribing event. Describes the lifecycle of the prescription + +URL: http://hl7.org/fhir/medication-request-status +ValueSet: http://hl7.org/fhir/ValueSet/medication-request-status +*/ +public enum MedicationRequestStatus: String { + + /// The prescription is 'actionable', but not all actions that are implied by it have occurred yet. + case active = "active" + + /// Actions implied by the prescription are to be temporarily halted, but are expected to continue later. May also + /// be called "suspended". + case onHold = "on-hold" + + /// The prescription has been withdrawn. + case cancelled = "cancelled" + + /// All actions that are implied by the prescription have occurred. + case completed = "completed" + + /// The prescription was entered in error. + case enteredInError = "entered-in-error" + + /// Actions implied by the prescription are to be permanently halted, before all of them occurred. + case stopped = "stopped" + + /// The prescription is not yet 'actionable', i.e. it is a work in progress, requires sign-off or verification, and + /// needs to be run through decision support process. + case draft = "draft" +} + + +/** +A coded concept identifying where the medication included in the is expected to be consumed or administered + +URL: http://hl7.org/fhir/medication-statement-category +ValueSet: http://hl7.org/fhir/ValueSet/medication-statement-category +*/ +public enum MedicationStatementCategory: String { + + /// Includes orders for medications to be administered or consumed in an inpatient or acute care setting + case inpatient = "inpatient" + + /// Includes orders for medications to be administered or consumed in an outpatient setting (for example, Emergency + /// Department, Outpatient Clinic, Outpatient Surgery, Doctor's office) + case outpatient = "outpatient" + + /// Includes orders for medications to be administered or consumed by the patient in their home (this would include + /// long term care or nursing homes, hospices, etc) + case community = "community" + + /// Includes statements about medication use, including over the counter medication, provided by the patient, agent + /// or another provider + case patientspecified = "patientspecified" +} + + +/** +A coded concept identifying level of certainty if patient has taken or has not taken the medication + +URL: http://hl7.org/fhir/medication-statement-nottaken +ValueSet: http://hl7.org/fhir/ValueSet/medication-statement-nottaken +*/ +public enum MedicationStatementNotTaken: String { + + /// Positive assertion that patient has taken medication + case Y = "y" + + /// Negative assertion that patient has not taken medication + case N = "n" + + /// Unknown assertion if patient has taken medication + case unk = "unk" +} + + +/** +A coded concept indicating the current status of a MedicationStatement. + +URL: http://hl7.org/fhir/medication-statement-status +ValueSet: http://hl7.org/fhir/ValueSet/medication-statement-status +*/ +public enum MedicationStatementStatus: String { + + /// The medication is still being taken. + case active = "active" + + /// The medication is no longer being taken. + case completed = "completed" + + /// The statement was entered in error. + case enteredInError = "entered-in-error" + + /// The medication may be taken at some time in the future. + case intended = "intended" + + /// Actions implied by the statement have been permanently halted, before all of them occurred. + case stopped = "stopped" + + /// Actions implied by the statement have been temporarily halted, but are expected to continue later. May also be + /// called "suspended". + case onHold = "on-hold" +} + + +/** +One of the message events defined as part of FHIR. + +URL: http://hl7.org/fhir/message-events +ValueSet: http://hl7.org/fhir/ValueSet/message-events +*/ +public enum MessageEvent: String { + + /// The definition of a code system is used to create a simple collection of codes suitable for use for data entry + /// or validation. An expanded code system will be returned, or an error message. + case codeSystemExpand = "CodeSystem-expand" + + /// Change the status of a Medication Administration to show that it is complete. + case medicationAdministrationComplete = "MedicationAdministration-Complete" + + /// Someone wishes to record that the record of administration of a medication is in error and should be ignored. + case medicationAdministrationNullification = "MedicationAdministration-Nullification" + + /// Indicates that a medication has been recorded against the patient's record. + case medicationAdministrationRecording = "MedicationAdministration-Recording" + + /// Update a Medication Administration record. + case medicationAdministrationUpdate = "MedicationAdministration-Update" + + /// Notification of a change to an administrative resource (either create or update). Note that there is no delete, + /// though some administrative resources have status or period elements for this use. + case adminNotify = "admin-notify" + + /// communicationRequest + case communicationRequest = "communication-request" + + /// Provide a diagnostic report, or update a previously provided diagnostic report. + case diagnosticreportProvide = "diagnosticreport-provide" + + /// Provide a simple observation or update a previously provided simple observation. + case observationProvide = "observation-provide" + + /// Notification that two patient records actually identify the same patient. + case patientLink = "patient-link" + + /// Notification that previous advice that two patient records concern the same patient is now considered incorrect. + case patientUnlink = "patient-unlink" + + /// The definition of a value set is used to create a simple collection of codes suitable for use for data entry or + /// validation. An expanded value set will be returned, or an error message. + case valuesetExpand = "valueset-expand" +} + + +/** +The impact of the content of a message. + +URL: http://hl7.org/fhir/message-significance-category +ValueSet: http://hl7.org/fhir/ValueSet/message-significance-category +*/ +public enum MessageSignificanceCategory: String { + + /// The message represents/requests a change that should not be processed more than once; e.g. Making a booking for + /// an appointment. + case consequence = "Consequence" + + /// The message represents a response to query for current information. Retrospective processing is wrong and/or + /// wasteful. + case currency = "Currency" + + /// The content is not necessarily intended to be current, and it can be reprocessed, though there may be version + /// issues created by processing old notifications. + case notification = "Notification" +} + + +/** +The protocol used for message transport. + +URL: http://hl7.org/fhir/message-transport +ValueSet: http://hl7.org/fhir/ValueSet/message-transport +*/ +public enum MessageTransport: String { + + /// The application sends or receives messages using HTTP POST (may be over http: or https:). + case http = "http" + + /// The application sends or receives messages using File Transfer Protocol. + case ftp = "ftp" + + /// The application sends or receives messages using HL7's Minimal Lower Level Protocol. + case mllp = "mllp" +} + + +/** +This value set is suitable for use with the provenance resource. It is derived from, but not compatible with, the HL7 v3 +Purpose of use Code system. + +URL: http://healthit.gov/nhin/purposeofuse +ValueSet: http://hl7.org/fhir/ValueSet/nhin-purposeofuse +*/ +public enum NHINPurposeOfUse: String { + + /// Treatment + case TREATMENT = "TREATMENT" + + /// Payment + case PAYMENT = "PAYMENT" + + /// Healthcare Operations + case OPERATIONS = "OPERATIONS" + + /// System Administration + case SYSADMIN = "SYSADMIN" + + /// Fraud detection + case FRAUD = "FRAUD" + + /// Use or disclosure of Psychotherapy Notes + case PSYCHOTHERAPY = "PSYCHOTHERAPY" + + /// Use or disclosure by the covered entity for its own training programs + case TRAINING = "TRAINING" + + /// Use or disclosure by the covered entity to defend itself in a legal action + case LEGAL = "LEGAL" + + /// Marketing + case MARKETING = "MARKETING" + + /// Use and disclosure for facility directories + case DIRECTORY = "DIRECTORY" + + /// Disclose to a family member, other relative, or a close personal friend of the individual + case FAMILY = "FAMILY" + + /// Uses and disclosures with the individual present. + case PRESENT = "PRESENT" + + /// Permission cannot practicably be provided because of the individual's incapacity or an emergency. + case EMERGENCY = "EMERGENCY" + + /// Use and disclosures for disaster relief purposes. + case DISASTER = "DISASTER" + + /// Uses and disclosures for public health activities. + case PUBLICHEALTH = "PUBLICHEALTH" + + /// Disclosures about victims of abuse, neglect or domestic violence. + case ABUSE = "ABUSE" + + /// Uses and disclosures for health oversight activities. + case OVERSIGHT = "OVERSIGHT" + + /// Disclosures for judicial and administrative proceedings. + case JUDICIAL = "JUDICIAL" + + /// Disclosures for law enforcement purposes. + case LAW = "LAW" + + /// Uses and disclosures about decedents. + case DECEASED = "DECEASED" + + /// Uses and disclosures for cadaveric organ, eye or tissue donation purposes + case DONATION = "DONATION" + + /// Uses and disclosures for research purposes. + case RESEARCH = "RESEARCH" + + /// Uses and disclosures to avert a serious threat to health or safety. + case THREAT = "THREAT" + + /// Uses and disclosures for specialized government functions. + case GOVERNMENT = "GOVERNMENT" + + /// Disclosures for workers' compensation. + case WORKERSCOMP = "WORKERSCOMP" + + /// Disclosures for insurance or disability coverage determination + case COVERAGE = "COVERAGE" + + /// Request of the Individual + case REQUEST = "REQUEST" +} + + +/** +The use of a human name + +URL: http://hl7.org/fhir/name-use +ValueSet: http://hl7.org/fhir/ValueSet/name-use +*/ +public enum NameUse: String { + + /// Known as/conventional/the one you normally use + case usual = "usual" + + /// The formal name as registered in an official (government) registry, but which name might not be commonly used. + /// May be called "legal name". + case official = "official" + + /// A temporary name. Name.period can provide more detailed information. This may also be used for temporary names + /// assigned at birth or in emergency situations. + case temp = "temp" + + /// A name that is used to address the person in an informal manner, but is not part of their formal or usual name + case nickname = "nickname" + + /// Anonymous assigned name, alias, or pseudonym (used to protect a person's identity for privacy reasons) + case anonymous = "anonymous" + + /// This name is no longer in use (or was never correct, but retained for records) + case old = "old" + + /// A name used prior to marriage. Marriage naming customs vary greatly around the world. This name use is for use + /// by applications that collect and store "maiden" names. Though the concept of maiden name is often gender + /// specific, the use of this term is not gender specific. The use of this term does not imply any particular + /// history for a person's name, nor should the maiden name be determined algorithmically. + case maiden = "maiden" +} + + +/** +Identifies the style of unique identifier used to identify a namespace. + +URL: http://hl7.org/fhir/namingsystem-identifier-type +ValueSet: http://hl7.org/fhir/ValueSet/namingsystem-identifier-type +*/ +public enum NamingSystemIdentifierType: String { + + /// An ISO object identifier; e.g. 1.2.3.4.5. + case oid = "oid" + + /// A universally unique identifier of the form a5afddf4-e880-459b-876e-e4591b0acc11. + case uuid = "uuid" + + /// A uniform resource identifier (ideally a URL - uniform resource locator); e.g. http://unitsofmeasure.org. + case uri = "uri" + + /// Some other type of unique identifier; e.g. HL7-assigned reserved string such as LN for LOINC. + case other = "other" +} + + +/** +Identifies the purpose of the naming system. + +URL: http://hl7.org/fhir/namingsystem-type +ValueSet: http://hl7.org/fhir/ValueSet/namingsystem-type +*/ +public enum NamingSystemType: String { + + /// The naming system is used to define concepts and symbols to represent those concepts; e.g. UCUM, LOINC, NDC + /// code, local lab codes, etc. + case codesystem = "codesystem" + + /// The naming system is used to manage identifiers (e.g. license numbers, order numbers, etc.). + case identifier = "identifier" + + /// The naming system is used as the root for other identifiers and naming systems. + case root = "root" +} + + +/** +The status of a resource narrative + +URL: http://hl7.org/fhir/narrative-status +ValueSet: http://hl7.org/fhir/ValueSet/narrative-status +*/ +public enum NarrativeStatus: String { + + /// The contents of the narrative are entirely generated from the structured data in the content. + case generated = "generated" + + /// The contents of the narrative are entirely generated from the structured data in the content and some of the + /// content is generated from extensions + case extensions = "extensions" + + /// The contents of the narrative may contain additional information not found in the structured data. Note that + /// there is no computable way to determine what the extra information is, other than by human inspection + case additional = "additional" + + /// The contents of the narrative are some equivalent of "No human-readable text provided in this case" + case empty = "empty" +} + + +/** +The presentation types of notes. + +URL: http://hl7.org/fhir/note-type +ValueSet: http://hl7.org/fhir/ValueSet/note-type +*/ +public enum NoteType: String { + + /// Display the note. + case display = "display" + + /// Print the note on the form. + case print = "print" + + /// Print the note for the operator. + case printoper = "printoper" +} + + +/** +Codes specifying the state of the request. Describes the lifecycle of the nutrition order. + +URL: http://hl7.org/fhir/nutrition-request-status +ValueSet: http://hl7.org/fhir/ValueSet/nutrition-request-status +*/ +public enum NutritionOrderStatus: String { + + /// The request has been proposed. + case proposed = "proposed" + + /// The request is in preliminary form prior to being sent. + case draft = "draft" + + /// The request has been planned. + case planned = "planned" + + /// The request has been placed. + case requested = "requested" + + /// The request is 'actionable', but not all actions that are implied by it have occurred yet. + case active = "active" + + /// Actions implied by the request have been temporarily halted, but are expected to continue later. May also be + /// called "suspended". + case onHold = "on-hold" + + /// All actions that are implied by the order have occurred and no continuation is planned (this will rarely be made + /// explicit). + case completed = "completed" + + /// The request has been withdrawn and is no longer actionable. + case cancelled = "cancelled" + + /// The request was entered in error and voided. + case enteredInError = "entered-in-error" +} + + +/** +Codes specifying how two observations are related. + +URL: http://hl7.org/fhir/observation-relationshiptypes +ValueSet: http://hl7.org/fhir/ValueSet/observation-relationshiptypes +*/ +public enum ObservationRelationshipType: String { + + /// This observation is a group observation (e.g. a battery, a panel of tests, a set of vital sign measurements) + /// that includes the target as a member of the group. + case hasMember = "has-member" + + /// The target resource (Observation or QuestionnaireResponse) is part of the information from which this + /// observation value is derived. (e.g. calculated anion gap, Apgar score) NOTE: "derived-from" is only logical + /// choice when referencing QuestionnaireResponse. + case derivedFrom = "derived-from" + + /// This observation follows the target observation (e.g. timed tests such as Glucose Tolerance Test). + case sequelTo = "sequel-to" + + /// This observation replaces a previous observation (i.e. a revised value). The target observation is now obsolete. + case replaces = "replaces" + + /// The value of the target observation qualifies (refines) the semantics of the source observation (e.g. a lipemia + /// measure target from a plasma measure). + case qualifiedBy = "qualified-by" + + /// The value of the target observation interferes (degrades quality, or prevents valid observation) with the + /// semantics of the source observation (e.g. a hemolysis measure target from a plasma potassium measure which has + /// no value). + case interferedBy = "interfered-by" +} + + +/** +Codes providing the status of an observation. + +URL: http://hl7.org/fhir/observation-status +ValueSet: http://hl7.org/fhir/ValueSet/observation-status +*/ +public enum ObservationStatus: String { + + /// The existence of the observation is registered, but there is no result yet available. + case registered = "registered" + + /// This is an initial or interim observation: data may be incomplete or unverified. + case preliminary = "preliminary" + + /// The observation is complete. + case final = "final" + + /// The observation has been modified subsequent to being Final. + case amended = "amended" + + /// The observation is unavailable because the measurement was not started or not completed (also sometimes called + /// "aborted"). + case cancelled = "cancelled" + + /// The observation has been withdrawn following previous final release. + case enteredInError = "entered-in-error" + + /// The observation status is unknown. Note that "unknown" is a value of last resort and every attempt should be + /// made to provide a meaningful value other than "unknown". + case unknown = "unknown" +} + + +/** +Whether an operation is a normal operation or a query. + +URL: http://hl7.org/fhir/operation-kind +ValueSet: http://hl7.org/fhir/ValueSet/operation-kind +*/ +public enum OperationKind: String { + + /// This operation is invoked as an operation. + case operation = "operation" + + /// This operation is a named query, invoked using the search mechanism. + case query = "query" +} + + +/** +Operation Outcome codes used by FHIR test servers (see Implementation file translations.xml) + +URL: http://hl7.org/fhir/operation-outcome +ValueSet: http://hl7.org/fhir/ValueSet/operation-outcome +*/ +public enum OperationOutcomeCodes: String { + + /// MSG_AUTH_REQUIRED + case MSG_AUTH_REQUIRED = "MSG_AUTH_REQUIRED" + + /// MSG_BAD_FORMAT + case MSG_BAD_FORMAT = "MSG_BAD_FORMAT" + + /// MSG_BAD_SYNTAX + case MSG_BAD_SYNTAX = "MSG_BAD_SYNTAX" + + /// MSG_CANT_PARSE_CONTENT + case MSG_CANT_PARSE_CONTENT = "MSG_CANT_PARSE_CONTENT" + + /// MSG_CANT_PARSE_ROOT + case MSG_CANT_PARSE_ROOT = "MSG_CANT_PARSE_ROOT" + + /// MSG_CREATED + case MSG_CREATED = "MSG_CREATED" + + /// MSG_DATE_FORMAT + case MSG_DATE_FORMAT = "MSG_DATE_FORMAT" + + /// MSG_DELETED + case MSG_DELETED = "MSG_DELETED" + + /// MSG_DELETED_DONE + case MSG_DELETED_DONE = "MSG_DELETED_DONE" + + /// MSG_DELETED_ID + case MSG_DELETED_ID = "MSG_DELETED_ID" + + /// MSG_DUPLICATE_ID + case MSG_DUPLICATE_ID = "MSG_DUPLICATE_ID" + + /// MSG_ERROR_PARSING + case MSG_ERROR_PARSING = "MSG_ERROR_PARSING" + + /// MSG_ID_INVALID + case MSG_ID_INVALID = "MSG_ID_INVALID" + + /// MSG_ID_TOO_LONG + case MSG_ID_TOO_LONG = "MSG_ID_TOO_LONG" + + /// MSG_INVALID_ID + case MSG_INVALID_ID = "MSG_INVALID_ID" + + /// MSG_JSON_OBJECT + case MSG_JSON_OBJECT = "MSG_JSON_OBJECT" + + /// MSG_LOCAL_FAIL + case MSG_LOCAL_FAIL = "MSG_LOCAL_FAIL" + + /// MSG_NO_MATCH + case MSG_NO_MATCH = "MSG_NO_MATCH" + + /// MSG_NO_EXIST + case MSG_NO_EXIST = "MSG_NO_EXIST" + + /// MSG_NO_MODULE + case MSG_NO_MODULE = "MSG_NO_MODULE" + + /// MSG_NO_SUMMARY + case MSG_NO_SUMMARY = "MSG_NO_SUMMARY" + + /// MSG_OP_NOT_ALLOWED + case MSG_OP_NOT_ALLOWED = "MSG_OP_NOT_ALLOWED" + + /// MSG_PARAM_CHAINED + case MSG_PARAM_CHAINED = "MSG_PARAM_CHAINED" + + /// MSG_PARAM_NO_REPEAT + case MSG_PARAM_NO_REPEAT = "MSG_PARAM_NO_REPEAT" + + /// MSG_PARAM_UNKNOWN + case MSG_PARAM_UNKNOWN = "MSG_PARAM_UNKNOWN" + + /// MSG_PARAM_INVALID + case MSG_PARAM_INVALID = "MSG_PARAM_INVALID" + + /// MSG_PARAM_MODIFIER_INVALID + case MSG_PARAM_MODIFIER_INVALID = "MSG_PARAM_MODIFIER_INVALID" + + /// MSG_RESOURCE_EXAMPLE_PROTECTED + case MSG_RESOURCE_EXAMPLE_PROTECTED = "MSG_RESOURCE_EXAMPLE_PROTECTED" + + /// MSG_RESOURCE_ID_FAIL + case MSG_RESOURCE_ID_FAIL = "MSG_RESOURCE_ID_FAIL" + + /// MSG_RESOURCE_NOT_ALLOWED + case MSG_RESOURCE_NOT_ALLOWED = "MSG_RESOURCE_NOT_ALLOWED" + + /// MSG_RESOURCE_REQUIRED + case MSG_RESOURCE_REQUIRED = "MSG_RESOURCE_REQUIRED" + + /// MSG_RESOURCE_ID_MISMATCH + case MSG_RESOURCE_ID_MISMATCH = "MSG_RESOURCE_ID_MISMATCH" + + /// MSG_RESOURCE_ID_MISSING + case MSG_RESOURCE_ID_MISSING = "MSG_RESOURCE_ID_MISSING" + + /// MSG_RESOURCE_TYPE_MISMATCH + case MSG_RESOURCE_TYPE_MISMATCH = "MSG_RESOURCE_TYPE_MISMATCH" + + /// MSG_SORT_UNKNOWN + case MSG_SORT_UNKNOWN = "MSG_SORT_UNKNOWN" + + /// MSG_TRANSACTION_DUPLICATE_ID + case MSG_TRANSACTION_DUPLICATE_ID = "MSG_TRANSACTION_DUPLICATE_ID" + + /// MSG_TRANSACTION_MISSING_ID + case MSG_TRANSACTION_MISSING_ID = "MSG_TRANSACTION_MISSING_ID" + + /// MSG_UNHANDLED_NODE_TYPE + case MSG_UNHANDLED_NODE_TYPE = "MSG_UNHANDLED_NODE_TYPE" + + /// MSG_UNKNOWN_CONTENT + case MSG_UNKNOWN_CONTENT = "MSG_UNKNOWN_CONTENT" + + /// MSG_UNKNOWN_OPERATION + case MSG_UNKNOWN_OPERATION = "MSG_UNKNOWN_OPERATION" + + /// MSG_UNKNOWN_TYPE + case MSG_UNKNOWN_TYPE = "MSG_UNKNOWN_TYPE" + + /// MSG_UPDATED + case MSG_UPDATED = "MSG_UPDATED" + + /// MSG_VERSION_AWARE + case MSG_VERSION_AWARE = "MSG_VERSION_AWARE" + + /// MSG_VERSION_AWARE_CONFLICT + case MSG_VERSION_AWARE_CONFLICT = "MSG_VERSION_AWARE_CONFLICT" + + /// MSG_VERSION_AWARE_URL + case MSG_VERSION_AWARE_URL = "MSG_VERSION_AWARE_URL" + + /// MSG_WRONG_NS + case MSG_WRONG_NS = "MSG_WRONG_NS" + + /// SEARCH_MULTIPLE + case SEARCH_MULTIPLE = "SEARCH_MULTIPLE" + + /// UPDATE_MULTIPLE_MATCHES + case UPDATE_MULTIPLE_MATCHES = "UPDATE_MULTIPLE_MATCHES" + + /// DELETE_MULTIPLE_MATCHES + case DELETE_MULTIPLE_MATCHES = "DELETE_MULTIPLE_MATCHES" + + /// SEARCH_NONE + case SEARCH_NONE = "SEARCH_NONE" +} + + +/** +Whether an operation parameter is an input or an output parameter. + +URL: http://hl7.org/fhir/operation-parameter-use +ValueSet: http://hl7.org/fhir/ValueSet/operation-parameter-use +*/ +public enum OperationParameterUse: String { + + /// This is an input parameter. + case `in` = "in" + + /// This is an output parameter. + case out = "out" +} + + +/** +The statistical operation parameter -"params" - codes + +URL: http://hl7.org/fhir/observation-paramcode +ValueSet: http://hl7.org/fhir/ValueSet/observation-paramcode +*/ +public enum ParamCode: String { + + /// The [mean](https://en.wikipedia.org/wiki/Arithmetic_mean)of N measurements over the stated period + case average = "average" + + /// The [maximum](https://en.wikipedia.org/wiki/Maximal_element) value of N measurements over the stated period + case max = "max" + + /// The [minimum](https://en.wikipedia.org/wiki/Minimal_element) value of N measurements over the stated period + case min = "min" + + /// The [number] of measurements over the stated period + case count = "count" +} + + +/** +Is the Participant required to attend the appointment. + +URL: http://hl7.org/fhir/participantrequired +ValueSet: http://hl7.org/fhir/ValueSet/participantrequired +*/ +public enum ParticipantRequired: String { + + /// The participant is required to attend the appointment. + case required = "required" + + /// The participant may optionally attend the appointment. + case optional = "optional" + + /// The participant is excluded from the appointment, and may not be informed of the appointment taking place. + /// (Appointment is about them, not for them - such as 2 doctors discussing results about a patient's test). + case informationOnly = "information-only" +} + + +/** +The Participation status of an appointment. + +URL: http://hl7.org/fhir/participationstatus +ValueSet: http://hl7.org/fhir/ValueSet/participationstatus +*/ +public enum ParticipationStatus: String { + + /// The participant has accepted the appointment. + case accepted = "accepted" + + /// The participant has declined the appointment and will not participate in the appointment. + case declined = "declined" + + /// The participant has tentatively accepted the appointment. This could be automatically created by a system and + /// requires further processing before it can be accepted. There is no commitment that attendance will occur. + case tentative = "tentative" + + /// The participant needs to indicate if they accept the appointment by changing this status to one of the other + /// statuses. + case needsAction = "needs-action" +} + + +/** +The type of payee Resource + +URL: http://hl7.org/fhir/ex-payee-resource-type +ValueSet: http://hl7.org/fhir/ValueSet/ex-payee-resource-type +*/ +public enum PayeeResourceType: String { + + /// Organization resource + case organization = "organization" + + /// Patient resource + case patient = "patient" + + /// Practitioner resource + case practitioner = "practitioner" + + /// RelatedPerson resource + case relatedperson = "relatedperson" +} + + +/** +A code specifying the state of the resource instance. + +URL: http://hl7.org/fhir/paymentnotice-status +ValueSet: http://hl7.org/fhir/ValueSet/paymentnotice-status +*/ +public enum PaymentNoticeStatus: String { + + /// The resource instance is currently in-force. + case active = "active" + + /// The resource instance is withdrawn, rescinded or reversed. + case cancelled = "cancelled" + + /// A new resource instance the contents of which is not complete. + case draft = "draft" + + /// The resource instance was entered in error. + case enteredInError = "entered-in-error" +} + + +/** +A code specifying the state of the resource instance. + +URL: http://hl7.org/fhir/paymentreconciliation-status +ValueSet: http://hl7.org/fhir/ValueSet/paymentreconciliation-status +*/ +public enum PaymentReconciliationStatus: String { + + /// The resource instance is currently in-force. + case active = "active" + + /// The resource instance is withdrawn, rescinded or reversed. + case cancelled = "cancelled" + + /// A new resource instance the contents of which is not complete. + case draft = "draft" + + /// The resource instance was entered in error. + case enteredInError = "entered-in-error" +} + + +/** +Defines behavior for an action or a group for how many times that item may be repeated + +URL: http://hl7.org/fhir/action-cardinality-behavior +ValueSet: http://hl7.org/fhir/ValueSet/action-cardinality-behavior +*/ +public enum PlanActionCardinalityBehavior: String { + + /// The action may only be selected one time + case single = "single" + + /// The action may be selected multiple times + case multiple = "multiple" +} + + +/** +Defines organization behavior of a group + +URL: http://hl7.org/fhir/action-grouping-behavior +ValueSet: http://hl7.org/fhir/ValueSet/action-grouping-behavior +*/ +public enum PlanActionGroupingBehavior: String { + + /// Any group marked with this behavior should be displayed as a visual group to the end user + case visualGroup = "visual-group" + + /// A group with this behavior logically groups its sub-elements, and may be shown as a visual group to the end + /// user, but it is not required to do so + case logicalGroup = "logical-group" + + /// A group of related alternative actions is a sentence group if the target referenced by the action is the same in + /// all the actions and each action simply constitutes a different variation on how to specify the details for the + /// target. For example, two actions that could be in a SentenceGroup are "aspirin, 500 mg, 2 times per day" and + /// "aspirin, 300 mg, 3 times per day". In both cases, aspirin is the target referenced by the action, and the two + /// actions represent different options for how aspirin might be ordered for the patient. Note that a SentenceGroup + /// would almost always have an associated selection behavior of "AtMostOne", unless it's a required action, in + /// which case, it would be "ExactlyOne" + case sentenceGroup = "sentence-group" +} + + +/** +The type of participant for the action + +URL: http://hl7.org/fhir/action-participant-type +ValueSet: http://hl7.org/fhir/ValueSet/action-participant-type +*/ +public enum PlanActionParticipantType: String { + + /// The participant is the patient under evaluation + case patient = "patient" + + /// The participant is a practitioner involved in the patient's care + case practitioner = "practitioner" + + /// The participant is a person related to the patient + case relatedPerson = "related-person" +} + + +/** +Defines selection frequency behavior for an action or group + +URL: http://hl7.org/fhir/action-precheck-behavior +ValueSet: http://hl7.org/fhir/ValueSet/action-precheck-behavior +*/ +public enum PlanActionPrecheckBehavior: String { + + /// An action with this behavior is one of the most frequent action that is, or should be, included by an end user, + /// for the particular context in which the action occurs. The system displaying the action to the end user should + /// consider "pre-checking" such an action as a convenience for the user + case yes = "yes" + + /// An action with this behavior is one of the less frequent actions included by the end user, for the particular + /// context in which the action occurs. The system displaying the actions to the end user would typically not "pre- + /// check" such an action + case no = "no" +} + + +/** +Defines the types of relationships between actions + +URL: http://hl7.org/fhir/action-relationship-type +ValueSet: http://hl7.org/fhir/ValueSet/action-relationship-type +*/ +public enum PlanActionRelationshipType: String { + + /// The action must be performed before the start of the related action + case beforeStart = "before-start" + + /// The action must be performed before the related action + case before = "before" + + /// The action must be performed before the end of the related action + case beforeEnd = "before-end" + + /// The action must be performed concurrent with the start of the related action + case concurrentWithStart = "concurrent-with-start" + + /// The action must be performed concurrent with the related action + case concurrent = "concurrent" + + /// The action must be performed concurrent with the end of the related action + case concurrentWithEnd = "concurrent-with-end" + + /// The action must be performed after the start of the related action + case afterStart = "after-start" + + /// The action must be performed after the related action + case after = "after" + + /// The action must be performed after the end of the related action + case afterEnd = "after-end" +} + + +/** +Defines requiredness behavior for selecting an action or an action group + +URL: http://hl7.org/fhir/action-required-behavior +ValueSet: http://hl7.org/fhir/ValueSet/action-required-behavior +*/ +public enum PlanActionRequiredBehavior: String { + + /// An action with this behavior must be included in the actions processed by the end user; the end user may not + /// choose not to include this action + case must = "must" + + /// An action with this behavior may be included in the set of actions processed by the end user + case could = "could" + + /// An action with this behavior must be included in the set of actions processed by the end user, unless the end + /// user provides documentation as to why the action was not included + case mustUnlessDocumented = "must-unless-documented" +} + + +/** +Defines selection behavior of a group + +URL: http://hl7.org/fhir/action-selection-behavior +ValueSet: http://hl7.org/fhir/ValueSet/action-selection-behavior +*/ +public enum PlanActionSelectionBehavior: String { + + /// Any number of the actions in the group may be chosen, from zero to all + case any = "any" + + /// All the actions in the group must be selected as a single unit + case all = "all" + + /// All the actions in the group are meant to be chosen as a single unit: either all must be selected by the end + /// user, or none may be selected + case allOrNone = "all-or-none" + + /// The end user must choose one and only one of the selectable actions in the group. The user may not choose none + /// of the actions in the group + case exactlyOne = "exactly-one" + + /// The end user may choose zero or at most one of the actions in the group + case atMostOne = "at-most-one" + + /// The end user must choose a minimum of one, and as many additional as desired + case oneOrMore = "one-or-more" +} + + +/** +The type of action to be performed + +URL: http://hl7.org/fhir/action-type +ValueSet: http://hl7.org/fhir/ValueSet/action-type +*/ +public enum PlanActionType: String { + + /// The action is to create a new resource + case create = "create" + + /// The action is to update an existing resource + case update = "update" + + /// The action is to remove an existing resource + case remove = "remove" + + /// The action is to fire a specific event + case fireEvent = "fire-event" +} + + +/** +The type of PlanDefinition + +URL: http://hl7.org/fhir/plan-definition-type +ValueSet: http://hl7.org/fhir/ValueSet/plan-definition-type +*/ +public enum PlanDefinitionType: String { + + /// A pre-defined and approved group of orders related to a particular clinical condition (e.g. hypertension + /// treatment and monitoring) or stage of care (e.g. hospital admission to Coronary Care Unit). An order set is used + /// as a checklist for the clinician when managing a patient with a specific condition. It is a structured + /// collection of orders relevant to that condition and presented to the clinician in a computerized provider order + /// entry (CPOE) system + case orderSet = "order-set" + + /// A set of activities that can be peformed that have relationships in terms of order, pre-conditions etc + case protocol_fhir = "protocol" + + /// A decision support rule of the form [on Event] if Condition then Action. It is intended to be a shareable, + /// computable definition of a actions that should be taken whenever some condition is met in response to a + /// particular event or events + case ecaRule = "eca-rule" +} + + +/** +The nature of the relationship with this procedure. + +URL: http://hl7.org/fhir/procedure-relationship-type +ValueSet: http://hl7.org/fhir/ValueSet/procedure-relationship-type +*/ +public enum ProcedureRelationshipType: String { + + /// This procedure had to be performed because of the related one. + case causedBy = "caused-by" + + /// This procedure caused the related one to be performed. + case becauseOf = "because-of" +} + + +/** +The priority of the request. + +URL: http://hl7.org/fhir/procedure-request-priority +ValueSet: http://hl7.org/fhir/ValueSet/procedure-request-priority +*/ +public enum ProcedureRequestPriority: String { + + /// The request has a normal priority. + case routine = "routine" + + /// The request should be done urgently. + case urgent = "urgent" + + /// The request is time-critical. + case stat = "stat" + + /// The request should be acted on as soon as possible. + case asap = "asap" +} + + +/** +The status of the request. + +URL: http://hl7.org/fhir/procedure-request-status +ValueSet: http://hl7.org/fhir/ValueSet/procedure-request-status +*/ +public enum ProcedureRequestStatus: String { + + /// The request has been proposed. + case proposed = "proposed" + + /// The request is in preliminary form, prior to being requested. + case draft = "draft" + + /// The request has been placed. + case requested = "requested" + + /// The receiving system has received the request but not yet decided whether it will be performed. + case received = "received" + + /// The receiving system has accepted the request, but work has not yet commenced. + case accepted = "accepted" + + /// The work to fulfill the request is happening. + case inProgress = "in-progress" + + /// The work has been completed, the report(s) released, and no further work is planned. + case completed = "completed" + + /// The request has been held by originating system/user request. + case suspended = "suspended" + + /// The receiving system has declined to fulfill the request. + case rejected = "rejected" + + /// The request was attempted, but due to some procedural error, it could not be completed. + case aborted = "aborted" +} + + +/** +A code specifying the state of the procedure. + +URL: http://hl7.org/fhir/procedure-status +ValueSet: http://hl7.org/fhir/ValueSet/procedure-status +*/ +public enum ProcedureStatus: String { + + /// The procedure is still occurring. + case inProgress = "in-progress" + + /// The procedure was terminated without completing successfully. + case aborted = "aborted" + + /// All actions involved in the procedure have taken place. + case completed = "completed" + + /// The statement was entered in error and Is not valid. + case enteredInError = "entered-in-error" + + /// The authoring system doesn't know the current state of the procedure. + case unknown = "unknown" +} + + +/** +A code specifying the state of the resource instance. + +URL: http://hl7.org/fhir/processrequest-status +ValueSet: http://hl7.org/fhir/ValueSet/processrequest-status +*/ +public enum ProcessRequestStatus: String { + + /// The resource instance is currently in-force. + case active = "active" + + /// The resource instance is withdrawn, rescinded or reversed. + case cancelled = "cancelled" + + /// A new resource instance the contents of which is not complete. + case draft = "draft" + + /// The resource instance was entered in error. + case enteredInError = "entered-in-error" +} + + +/** +A code specifying the state of the resource instance. + +URL: http://hl7.org/fhir/processresponse-status +ValueSet: http://hl7.org/fhir/ValueSet/processresponse-status +*/ +public enum ProcessResponseStatus: String { + + /// The resource instance is currently in-force. + case active = "active" + + /// The resource instance is withdrawn, rescinded or reversed. + case cancelled = "cancelled" + + /// A new resource instance the contents of which is not complete. + case draft = "draft" + + /// The resource instance was entered in error. + case enteredInError = "entered-in-error" +} + + +/** +How a property is represented on the wire. + +URL: http://hl7.org/fhir/property-representation +ValueSet: http://hl7.org/fhir/ValueSet/property-representation +*/ +public enum PropertyRepresentation: String { + + /// In XML, this property is represented as an attribute not an element. + case xmlAttr = "xmlAttr" + + /// This element is represented using the XML text attribute (primitives only) + case xmlText = "xmlText" + + /// The type of this element is indicated using xsi:type + case typeAttr = "typeAttr" + + /// Use CDA narrative instead of XHTML + case cdaText = "cdaText" + + /// The property is represented using XHTML + case xhtml = "xhtml" +} + + +/** +The type of a property value + +URL: http://hl7.org/fhir/concept-property-type +ValueSet: http://hl7.org/fhir/ValueSet/concept-property-type +*/ +public enum PropertyType: String { + + /// The property value is a code that identifies a concept defined in the code system + case code = "code" + + /// The property value is a code defined in an external code system. This may be used for translations, but is not + /// the intent + case coding = "Coding" + + /// The property value is a string + case string = "string" + + /// The property value is a string (often used to assign ranking values to concepts for supporting score + /// assessments) + case integer = "integer" + + /// The property value is a boolean true | false + case boolean = "boolean" + + /// The property is a date or a date + time + case dateTime = "dateTime" +} + + +/** +How an entity was used in an activity. + +URL: http://hl7.org/fhir/provenance-entity-role +ValueSet: http://hl7.org/fhir/ValueSet/provenance-entity-role +*/ +public enum ProvenanceEntityRole: String { + + /// A transformation of an entity into another, an update of an entity resulting in a new one, or the construction + /// of a new entity based on a preexisting entity. + case derivation = "derivation" + + /// A derivation for which the resulting entity is a revised version of some original. + case revision = "revision" + + /// The repeat of (some or all of) an entity, such as text or image, by someone who may or may not be its original + /// author. + case quotation = "quotation" + + /// A primary source for a topic refers to something produced by some agent with direct experience and knowledge + /// about the topic, at the time of the topic's study, without benefit from hindsight. + case source = "source" + + /// A derivation for which the entity is removed from accessibility usually through the use of the Delete operation. + case removal = "removal" +} + + +/** +The lifecycle status of a Value Set or Concept Map. + +URL: http://hl7.org/fhir/publication-status +ValueSet: http://hl7.org/fhir/ValueSet/publication-status +*/ +public enum PublicationStatus: String { + + /// This resource is still under development. + case draft = "draft" + + /// This resource is ready for normal use. + case active = "active" + + /// This resource has been withdrawn or superseded and should no longer be used. + case retired = "retired" +} + + +/** +A rating system that describes the quality of evidence such as the GRADE, DynaMed, or Oxford CEBM systems + +URL: http://hl7.org/fhir/evidence-quality +ValueSet: http://hl7.org/fhir/ValueSet/cqif-evidence-quality +*/ +public enum QualityOfEvidenceRating: String { + + /// High quality evidence + case high = "high" + + /// Moderate quality evidence + case moderate = "moderate" + + /// Low quality evidence + case low = "low" + + /// Very low quality evidence + case veryLow = "very-low" +} + + +/** +How the Quantity should be understood and represented. + +URL: http://hl7.org/fhir/quantity-comparator +ValueSet: http://hl7.org/fhir/ValueSet/quantity-comparator +*/ +public enum QuantityComparator: String { + + /// The actual value is less than the given value. + case lt = "<" + + /// The actual value is less than or equal to the given value. + case lte = "<=" + + /// The actual value is greater than or equal to the given value. + case gte = ">=" + + /// The actual value is greater than the given value. + case gt = ">" +} + + +/** +Distinguishes groups from questions and display text and indicates data type for questions + +URL: http://hl7.org/fhir/item-type +ValueSet: http://hl7.org/fhir/ValueSet/item-type +*/ +public enum QuestionnaireItemType: String { + + /// An item with no direct answer but which has descendant items that are questions + case group = "group" + + /// Text for display that will not capture an answer or have descendants + case display = "display" + + /// An item that defines a specific answer to be captured (and may have descendant items) + case question = "question" + + /// Question with a yes/no answer + case boolean = "boolean" + + /// Question with is a real number answer + case decimal = "decimal" + + /// Question with an integer answer + case integer = "integer" + + /// Question with adate answer + case date = "date" + + /// Question with a date and time answer + case dateTime = "dateTime" + + /// Question with a system timestamp answer + case instant = "instant" + + /// Question with a time (hour/minute/second) answer independent of date. + case time = "time" + + /// Question with a short (few words to short sentence) free-text entry answer + case string = "string" + + /// Question with a long (potentially multi-paragraph) free-text entry (still captured as a string) answer + case text = "text" + + /// Question with a url (website, FTP site, etc.) answer + case url = "url" + + /// Question with a Coding drawn from a list of options as an answer + case choice = "choice" + + /// Answer is a Coding drawn from a list of options or a free-text entry captured as Coding.display + case openChoice = "open-choice" + + /// Question with binary content such as a image, PDF, etc. as an answer + case attachment = "attachment" + + /// Question with a reference to another resource (practitioner, organization, etc.) as an answer + case reference = "reference" + + /// Question with a combination of a numeric value and unit, potentially with a comparator (<, >, etc.) as an + /// answer. + case quantity = "quantity" +} + + +/** +Identifies the modes of usage of a questionnaire that should enable a particular questionnaire item + +URL: http://hl7.org/fhir/questionnaire-usage-mode +ValueSet: http://hl7.org/fhir/ValueSet/questionnaire-usage-mode +*/ +public enum QuestionnaireItemUsageMode: String { + + /// Render the item regardless of usage mode + case captureDisplay = "capture-display" + + /// Render the item only when capturing data + case capture = "capture" + + /// Render the item only when displaying a completed form + case display = "display" + + /// Render the item only when displaying a completed form and the item has been answered (or has child items that + /// have been answered) + case displayNonEmpty = "display-non-empty" + + /// Render the item when capturing data or when displaying a completed form and the item has been answered (or has + /// child items that have been answered) + case captureDisplayNonEmpty = "capture-display-non-empty" +} + + +/** +Lifecycle status of the questionnaire response. + +URL: http://hl7.org/fhir/questionnaire-answers-status +ValueSet: http://hl7.org/fhir/ValueSet/questionnaire-answers-status +*/ +public enum QuestionnaireResponseStatus: String { + + /// This QuestionnaireResponse has been partially filled out with answers, but changes or additions are still + /// expected to be made to it. + case inProgress = "in-progress" + + /// This QuestionnaireResponse has been filled out with answers, and the current content is regarded as definitive. + case completed = "completed" + + /// This QuestionnaireResponse has been filled out with answers, then marked as complete, yet changes or additions + /// have been made to it afterwards. + case amended = "amended" + + /// This QuestionnaireResponse was entered in error and voided. + case enteredInError = "entered-in-error" +} + + +/** +Lifecycle status of the questionnaire. + +URL: http://hl7.org/fhir/questionnaire-status +ValueSet: http://hl7.org/fhir/ValueSet/questionnaire-status +*/ +public enum QuestionnaireStatus: String { + + /// This Questionnaire is not ready for official use. + case draft = "draft" + + /// This Questionnaire is ready for use. + case published = "published" + + /// This Questionnaire should no longer be used to gather data. + case retired = "retired" +} + + +/** +A set of flags that defines how references are supported + +URL: http://hl7.org/fhir/reference-handling-policy +ValueSet: http://hl7.org/fhir/ValueSet/reference-handling-policy +*/ +public enum ReferenceHandlingPolicy: String { + + /// The server supports and populates Literal references where they are known (this code does not guarantee that all + /// references are literal; see 'enforced') + case literal = "literal" + + /// The server allows logical references + case logical = "logical" + + /// The server will attempt to resolve logical references to literal references (if resolution fails, the server may + /// still accept resources; see logical) + case resolves = "resolves" + + /// The server enforces that references have integrity - e.g. it ensures that references can always be resolved. + /// This is typically the case for clinical record systems, but often no the case for middleware/proxy systems + case enforced = "enforced" + + /// The server does not support references that point to other servers + case local = "local" +} + + +/** +Whether a reference needs to be version specific or version independent, or whetehr either can be used + +URL: http://hl7.org/fhir/reference-version-rules +ValueSet: http://hl7.org/fhir/ValueSet/reference-version-rules +*/ +public enum ReferenceVersionRules: String { + + /// The reference may be either version independent or version specific + case either = "either" + + /// The reference must be version independent + case independent = "independent" + + /// The reference must be version specific + case specific = "specific" +} + + +/** +Identifies the degree of intention/authorization associated with the request + +URL: http://hl7.org/fhir/referralcategory +ValueSet: http://hl7.org/fhir/ValueSet/referralcategory +*/ +public enum ReferralCategory: String { + + /// The referral request represents a suggestion or recommendation that a referral be made. + case proposal = "proposal" + + /// The referral request represents an intention by the author to make a referral, but no actual referral has yet + /// been made/authorized. + case plan = "plan" + + /// This is an actual referral request which, when active, will have the authorizations needed to allow it to be + /// actioned. + case request = "request" +} + + +/** +The methods of referral can be used when referring to a specific HealthCareService resource. + +URL: http://hl7.org/fhir/service-referral-method +ValueSet: http://hl7.org/fhir/ValueSet/service-referral-method +*/ +public enum ReferralMethod: String { + + /// Referrals may be accepted by fax. + case fax = "fax" + + /// Referrals may be accepted over the phone from a practitioner. + case phone = "phone" + + /// Referrals may be accepted via a secure messaging system. To determine the types of secure messaging systems + /// supported, refer to the identifiers collection. Callers will need to understand the specific identifier system + /// used to know that they are able to transmit messages. + case elec = "elec" + + /// Referrals may be accepted via a secure email. To send please enrypt with the services public key. + case semail = "semail" + + /// Referrals may be accepted via regular postage (or hand delivered). + case mail = "mail" +} + + +/** +The status of the referral. + +URL: http://hl7.org/fhir/referralstatus +ValueSet: http://hl7.org/fhir/ValueSet/referralstatus +*/ +public enum ReferralStatus: String { + + /// A draft referral that has yet to be send. + case draft = "draft" + + /// The referral is complete and is ready for fulfillment. + case active = "active" + + /// The referral has been cancelled without being completed. For example it is no longer needed. + case cancelled = "cancelled" + + /// The referral has been completely actioned. + case completed = "completed" + + /// This referral record should never have existed, though it's possible some degree of real-world activity or + /// decisions may have been taken due to its existence + case enteredInError = "entered-in-error" +} + + +/** +The type of relationship to the related artifact + +URL: http://hl7.org/fhir/related-artifact-type +ValueSet: http://hl7.org/fhir/ValueSet/related-artifact-type +*/ +public enum RelatedArtifactType: String { + + /// Additional documentation for the knowledge resource. This would include additional instructions on usage as well + /// as additional information on clinical context or appropriateness + case documentation = "documentation" + + /// A summary of the justification for the knowledge resource including supporting evidence, relevant guidelines, or + /// other clinically important information. This information is intended to provide a way to make the justification + /// for the knowledge resource available to the consumer of interventions or results produced by the knowledge + /// resource + case justification = "justification" + + /// Bibliographic citation for papers, references, or other relevant material for the knowledge resource. This is + /// intended to allow for citation of related material, but that was not necessarily specifically prepared in + /// connection with this knowledge resource + case citation = "citation" + + /// The previous version of the knowledge resource + case predecessor = "predecessor" + + /// The next version of the knowledge resource + case successor = "successor" + + /// The knowledge resource is derived from the related artifact. This is intended to capture the relationship in + /// which a particular knowledge resource is based on the content of another artifact, but is modified to capture + /// either a different set of overall requirements, or a more specific set of requirements such as those involved in + /// a particular institution or clinical setting + case derivedFrom = "derived-from" + + /// The knowledge resource depends on the given related artifact + case dependsOn = "depends-on" + + /// The knowledge resource is composed of the given related artifact + case composedOf = "composed-of" +} + + +/** +The clinical priority of an order. + +URL: http://hl7.org/fhir/request-priority +ValueSet: http://hl7.org/fhir/ValueSet/request-priority +*/ +public enum RequestPriority: String { + + /// The order has a normal priority . + case routine = "routine" + + /// The order should be urgently. + case urgent = "urgent" + + /// The order is time-critical. + case stat = "stat" + + /// The order should be acted on as soon as possible. + case asap = "asap" +} + + +/** +The kind of request. + +URL: http://hl7.org/fhir/request-stage +ValueSet: http://hl7.org/fhir/ValueSet/request-stage +*/ +public enum RequestStage: String { + + /// The request is a proposal + case proposal = "proposal" + + /// The request is a plan + case plan = "plan" + + /// The request is an order. + case originalOrder = "original-order" + + /// Represents an order created by a fulfiller as a representation of the specific action(s) they intend to take to + /// fulfill the original order. Typically these orders are more fully encoded than the original placer order. + case encoded = "encoded" + + /// Represents a separate order created by a fulfiller as result of fulfilment of an order. + case reflexOrder = "reflex-order" +} + + +/** +The type of payee Resource + +URL: http://hl7.org/fhir/resource-type-link +ValueSet: http://hl7.org/fhir/ValueSet/resource-type-link +*/ +public enum ResourceTypeLink: String { + + /// Organization resource + case organization = "organization" + + /// Patient resource + case patient = "patient" + + /// Practitioner resource + case practitioner = "practitioner" + + /// RelatedPerson resource + case relatedperson = "relatedperson" +} + + +/** +Codes indicating the type of validation to perform + +URL: http://hl7.org/fhir/resource-validation-mode +ValueSet: http://hl7.org/fhir/ValueSet/resource-validation-mode +*/ +public enum ResourceValidationMode: String { + + /// The server checks the content, and then checks that the content would be acceptable as a create (e.g. that the + /// content would not violate any uniqueness constraints). + case create = "create" + + /// The server checks the content, and then checks that it would accept it as an update against the nominated + /// specific resource (e.g. that there are no changes to immutable fields the server does not allow to change, and + /// checking version integrity if appropriate). + case update = "update" + + /// The server ignores the content, and checks that the nominated resource is allowed to be deleted (e.g. checking + /// referential integrity rules). + case delete = "delete" +} + + +/** +How the system supports versioning for a resource. + +URL: http://hl7.org/fhir/versioning-policy +ValueSet: http://hl7.org/fhir/ValueSet/versioning-policy +*/ +public enum ResourceVersionPolicy: String { + + /// VersionId meta-property is not supported (server) or used (client). + case noVersion = "no-version" + + /// VersionId meta-property is supported (server) or used (client). + case versioned = "versioned" + + /// VersionId is must be correct for updates (server) or will be specified (If-match header) for updates (client). + case versionedUpdate = "versioned-update" +} + + +/** +The kind of response to a message + +URL: http://hl7.org/fhir/response-code +ValueSet: http://hl7.org/fhir/ValueSet/response-code +*/ +public enum ResponseType: String { + + /// The message was accepted and processed without error. + case ok = "ok" + + /// Some internal unexpected error occurred - wait and try again. Note - this is usually used for things like + /// database unavailable, which may be expected to resolve, though human intervention may be required. + case transientError = "transient-error" + + /// The message was rejected because of some content in it. There is no point in re-sending without change. The + /// response narrative SHALL describe the issue. + case fatalError = "fatal-error" +} + + +/** +The mode of a RESTful capability statement. + +URL: http://hl7.org/fhir/restful-capability-mode +ValueSet: http://hl7.org/fhir/ValueSet/restful-capability-mode +*/ +public enum RestfulCapabilityMode: String { + + /// The application acts as a client for this resource. + case client = "client" + + /// The application acts as a server for this resource. + case server = "server" +} + + +/** +Types of security services used with FHIR. + +URL: http://hl7.org/fhir/restful-security-service +ValueSet: http://hl7.org/fhir/ValueSet/restful-security-service +*/ +public enum RestfulSecurityService: String { + + /// Oauth (unspecified version see oauth.net). + case oAuth = "OAuth" + + /// OAuth2 using SMART-on-FHIR profile (see http://docs.smarthealthit.org/). + case sMARTOnFHIR = "SMART-on-FHIR" + + /// Microsoft NTLM Authentication. + case NTLM = "NTLM" + + /// Basic authentication defined in HTTP specification. + case basic = "Basic" + + /// see http://www.ietf.org/rfc/rfc4120.txt. + case kerberos = "Kerberos" + + /// SSL where client must have a certificate registered with the server. + case certificates = "Certificates" +} + + +/** +Why an entry is in the result set - whether it's included as a match or because of an _include requirement. + +URL: http://hl7.org/fhir/search-entry-mode +ValueSet: http://hl7.org/fhir/ValueSet/search-entry-mode +*/ +public enum SearchEntryMode: String { + + /// This resource matched the search specification. + case match = "match" + + /// This resource is returned because it is referred to from another resource in the search set. + case include = "include" + + /// An OperationOutcome that provides additional information about the processing of a search. + case outcome = "outcome" +} + + +/** +A supported modifier for a search parameter. + +URL: http://hl7.org/fhir/search-modifier-code +ValueSet: http://hl7.org/fhir/ValueSet/search-modifier-code +*/ +public enum SearchModifierCode: String { + + /// The search parameter returns resources that have a value or not. + case missing = "missing" + + /// The search parameter returns resources that have a value that exactly matches the supplied parameter (the whole + /// string, including casing and accents). + case exact = "exact" + + /// The search parameter returns resources that include the supplied parameter value anywhere within the field being + /// searched. + case contains = "contains" + + /// The search parameter returns resources that do not contain a match . + case not = "not" + + /// The search parameter is processed as a string that searches text associated with the code/value - either + /// CodeableConcept.text, Coding.display, or Identifier.type.text. + case text = "text" + + /// The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests + /// whether the coding is in the specified value set. + case `in` = "in" + + /// The search parameter is a URI (relative or absolute) that identifies a value set, and the search parameter tests + /// whether the coding is not in the specified value set. + case notIn = "not-in" + + /// The search parameter tests whether the value in a resource is subsumed by the specified value (is-a, or + /// hierarchical relationships). + case below = "below" + + /// The search parameter tests whether the value in a resource subsumes the specified value (is-a, or hierarchical + /// relationships). + case above = "above" + + /// The search parameter only applies to the Resource Type specified as a modifier (e.g. the modifier is not + /// actually :type, but :Patient etc.). + case type = "type" +} + + +/** +Data types allowed to be used for search parameters. + +URL: http://hl7.org/fhir/search-param-type +ValueSet: http://hl7.org/fhir/ValueSet/search-param-type +*/ +public enum SearchParamType: String { + + /// Search parameter SHALL be a number (a whole number, or a decimal). + case number = "number" + + /// Search parameter is on a date/time. The date format is the standard XML format, though other formats may be + /// supported. + case date = "date" + + /// Search parameter is a simple string, like a name part. Search is case-insensitive and accent-insensitive. May + /// match just the start of a string. String parameters may contain spaces. + case string = "string" + + /// Search parameter on a coded element or identifier. May be used to search through the text, displayname, code and + /// code/codesystem (for codes) and label, system and key (for identifier). Its value is either a string or a pair + /// of namespace and value, separated by a "|", depending on the modifier used. + case token = "token" + + /// A reference to another resource. + case reference = "reference" + + /// A composite search parameter that combines a search on two values together. + case composite = "composite" + + /// A search parameter that searches on a quantity. + case quantity = "quantity" + + /// A search parameter that searches on a URI (RFC 3986). + case uri = "uri" +} + + +/** +Codes providing the status of the variant test result + +URL: http://hl7.org/fhir/variant-state +ValueSet: http://hl7.org/fhir/ValueSet/variant-state +*/ +public enum SequenceStatus: String { + + /// the variant is detected + case positive = "positive" + + /// no variant is detected + case negative = "negative" + + /// result of the variant is missing + case absent = "absent" +} + + +/** +Type if a sequence -- DNA, RNA, or amino acid sequence + +URL: http://hl7.org/fhir/sequence-type +ValueSet: http://hl7.org/fhir/ValueSet/sequence-type +*/ +public enum SequenceType: String { + + /// Amino acid sequence + case AA = "AA" + + /// DNA Sequence + case DNA = "DNA" + + /// RNA Sequence + case RNA = "RNA" +} + + +/** +The code(s) that detail the conditions under which the healthcare service is available/offered. + +URL: http://hl7.org/fhir/service-provision-conditions +ValueSet: http://hl7.org/fhir/ValueSet/service-provision-conditions +*/ +public enum ServiceProvisionConditions: String { + + /// This service is available for no patient cost. + case free = "free" + + /// There are discounts available on this service for qualifying patients. + case disc = "disc" + + /// Fees apply for this service. + case cost = "cost" +} + + +/** +How slices are interpreted when evaluating an instance. + +URL: http://hl7.org/fhir/resource-slicing-rules +ValueSet: http://hl7.org/fhir/ValueSet/resource-slicing-rules +*/ +public enum SlicingRules: String { + + /// No additional content is allowed other than that described by the slices in this profile. + case closed = "closed" + + /// Additional content is allowed anywhere in the list. + case open = "open" + + /// Additional content is allowed, but only at the end of the list. Note that using this requires that the slices be + /// ordered, which makes it hard to share uses. This should only be done where absolutely required. + case openAtEnd = "openAtEnd" +} + + +/** +The free/busy status of the slot. + +URL: http://hl7.org/fhir/slotstatus +ValueSet: http://hl7.org/fhir/ValueSet/slotstatus +*/ +public enum SlotStatus: String { + + /// Indicates that the time interval is busy because one or more events have been scheduled for that interval. + case busy = "busy" + + /// Indicates that the time interval is free for scheduling. + case free = "free" + + /// Indicates that the time interval is busy and that the interval can not be scheduled. + case busyUnavailable = "busy-unavailable" + + /// Indicates that the time interval is busy because one or more events have been tentatively scheduled for that + /// interval. + case busyTentative = "busy-tentative" + + /// This instance should not have been part of this patient's medical record. + case enteredInError = "entered-in-error" +} + + +/** +A set of generally useful codes defined so they can be included in value sets. + +URL: http://hl7.org/fhir/special-values +ValueSet: http://hl7.org/fhir/ValueSet/special-values +*/ +public enum SpecialValues: String { + + /// Boolean true. + case `true` = "true" + + /// Boolean false. + case `false` = "false" + + /// The content is greater than zero, but too small to be quantified. + case trace = "trace" + + /// The specific quantity is not known, but is known to be non-zero and is not specified because it makes up the + /// bulk of the material. + case sufficient = "sufficient" + + /// The value is no longer available. + case withdrawn = "withdrawn" + + /// The are no known applicable values in this context. + case nilKnown = "nil-known" +} + + +/** +Codes providing the status/availability of a specimen. + +URL: http://hl7.org/fhir/specimen-status +ValueSet: http://hl7.org/fhir/ValueSet/specimen-status +*/ +public enum SpecimenStatus: String { + + /// The physical specimen is present and in good condition. + case available = "available" + + /// There is no physical specimen because it is either lost, destroyed or consumed. + case unavailable = "unavailable" + + /// The specimen cannot be used because of a quality issue such as a broken container, contamination, or too old. + case unsatisfactory = "unsatisfactory" + + /// The specimen was entered in error and therefore nullified. + case enteredInError = "entered-in-error" +} + + +/** +A rating system that describes the strength of the recommendation, such as the GRADE, DynaMed, or HGPS systems + +URL: http://hl7.org/fhir/recommendation-strength +ValueSet: http://hl7.org/fhir/ValueSet/cqif-recommendation-strength +*/ +public enum StrengthOfRecommendationRating: String { + + /// Strong recommendation + case strong = "strong" + + /// Weak recommendation + case weak = "weak" +} + + +/** +Defines the type of structure that a definition is describing. + +URL: http://hl7.org/fhir/structure-definition-kind +ValueSet: http://hl7.org/fhir/ValueSet/structure-definition-kind +*/ +public enum StructureDefinitionKind: String { + + /// A data type, which is a primitive type that has a value and an extension. These can be used throughout Resource + /// and extension definitions. Only tbe base specification can define primitive types. + case primitiveType = "primitive-type" + + /// A data type - either a complex structure that defines a set of data elements. These can be used throughout + /// Resource and extension definitions, and in logical models. + case complexType = "complex-type" + + /// A resource defined by the FHIR specification. + case resource = "resource" + + /// A logical model - a conceptual package of data that will be mapped to resources for implementation. + case logical = "logical" +} + + +/** +How to interpret the context + +URL: http://hl7.org/fhir/map-context-type +ValueSet: http://hl7.org/fhir/ValueSet/map-context-type +*/ +public enum StructureMapContextType: String { + + /// The context specifies a type + case type = "type" + + /// The context specifies a variable + case variable = "variable" +} + + +/** +Mode for this instance of data + +URL: http://hl7.org/fhir/map-input-mode +ValueSet: http://hl7.org/fhir/ValueSet/map-input-mode +*/ +public enum StructureMapInputMode: String { + + /// Names an input instance used a source for mapping + case source = "source" + + /// Names an instance that is being populated + case target = "target" +} + + +/** +If field is a list, how to manage the list + +URL: http://hl7.org/fhir/map-list-mode +ValueSet: http://hl7.org/fhir/ValueSet/map-list-mode +*/ +public enum StructureMapListMode: String { + + /// when the target list is being assembled, the items for this rule go first. If more that one rule defines a first + /// item (for a given instance of mapping) then this is an error + case first = "first" + + /// the target instance is shared with the target instances generated by another rule (up to the first common n + /// items, then create new ones) + case share = "share" + + /// when the target list is being assembled, the items for this rule go last. If more that one rule defines a last + /// item (for a given instance of mapping) then this is an error + case last = "last" +} + + +/** +How the referenced structure is used in this mapping + +URL: http://hl7.org/fhir/map-model-mode +ValueSet: http://hl7.org/fhir/ValueSet/map-model-mode +*/ +public enum StructureMapModelMode: String { + + /// This structure describes an instance passed to the mapping engine that is used a source of data + case source = "source" + + /// This structure describes an instance that the mapping engine may ask for that is used a source of data + case queried = "queried" + + /// This structure describes an instance passed to the mapping engine that is used a target of data + case target = "target" + + /// This structure describes an instance that the mapping engine may ask to create that is used a target of data + case produced = "produced" +} + + +/** +How data is copied / created + +URL: http://hl7.org/fhir/map-transform +ValueSet: http://hl7.org/fhir/ValueSet/map-transform +*/ +public enum StructureMapTransform: String { + + /// create(type : string) - type is passed through to the application on the standard API, and must be known by it + case create = "create" + + /// copy(source) + case copy = "copy" + + /// truncate(source, length) - source must be stringy type + case truncate = "truncate" + + /// escape(source, fmt1, fmt2) - change source from one kind of escaping to another (plain, java, xml, json). note + /// that this is for when the string itself is escaped + case escape = "escape" + + /// cast(source, type?) - case source from one type to another. target type can be left as implicit if there is one + /// and only one target type known + case cast = "cast" + + /// append(source...) - source is element or string + case append = "append" + + /// translate(source, uri_of_map) - use the translate operation + case translate = "translate" + + /// reference(source : object) - return a string that references the provided tree properly + case reference = "reference" + + /// Perform a date operation. Parameters to be documented + case dateOp = "dateOp" + + /// Generate a random UUID (in lowercase). No Parameters + case uuid = "uuid" + + /// Return the appropriate string to put in a Reference that refers to the resource provided as a parameter + case pointer = "pointer" + + /// Execute the supplied fluentpath expression and use the value returned by that + case evaluate = "evaluate" + + /// Create a CodeableConcept. Parameters = (text) or (system. Code[, display]) + case cc = "cc" + + /// Create a Coding. Parameters = (system. Code[, display]) + case C = "c" + + /// Create a quantity. Parameters = (text) or (value, unit, [system, code]) where text =s the natural represenation + /// e.g. [comparator]value[space]unit + case qty = "qty" + + /// Create an identifier. Parameters = (system, value[, type]) where type is a code from the identifier type value + /// set + case id = "id" + + /// Create a contact details. Parameters = (value) or (system, value). If no system is provided, the system should + /// be inferred from the content of the value + case cp = "cp" +} + + +/** +The type of method used to execute a subscription. + +URL: http://hl7.org/fhir/subscription-channel-type +ValueSet: http://hl7.org/fhir/ValueSet/subscription-channel-type +*/ +public enum SubscriptionChannelType: String { + + /// The channel is executed by making a post to the URI. If a payload is included, the URL is interpreted as the + /// service base, and an update (PUT) is made. + case restHook = "rest-hook" + + /// The channel is executed by sending a packet across a web socket connection maintained by the client. The URL + /// identifies the websocket, and the client binds to this URL. + case websocket = "websocket" + + /// The channel is executed by sending an email to the email addressed in the URI (which must be a mailto:). + case email = "email" + + /// The channel is executed by sending an SMS message to the phone number identified in the URL (tel:). + case sms = "sms" + + /// The channel is executed by sending a message (e.g. a Bundle with a MessageHeader resource etc.) to the + /// application identified in the URI. + case message = "message" +} + + +/** +The status of a subscription. + +URL: http://hl7.org/fhir/subscription-status +ValueSet: http://hl7.org/fhir/ValueSet/subscription-status +*/ +public enum SubscriptionStatus: String { + + /// The client has requested the subscription, and the server has not yet set it up. + case requested = "requested" + + /// The subscription is active. + case active = "active" + + /// The server has an error executing the notification. + case error = "error" + + /// Too many errors have occurred or the subscription has expired. + case off = "off" +} + + +/** +Tags to put on a resource after subscriptions have been sent. + +URL: http://hl7.org/fhir/subscription-tag +ValueSet: http://hl7.org/fhir/ValueSet/subscription-tag +*/ +public enum SubscriptionTag: String { + + /// The message has been queued for processing on a destination systems. + case queued = "queued" + + /// The message has been delivered to its intended recipient. + case delivered = "delivered" +} + + +/** +Status of the supply delivery. + +URL: http://hl7.org/fhir/supplydelivery-status +ValueSet: http://hl7.org/fhir/ValueSet/supplydelivery-status +*/ +public enum SupplyDeliveryStatus: String { + + /// Supply has been requested, but not delivered. + case inProgress = "in-progress" + + /// Supply has been delivered ("completed"). + case completed = "completed" + + /// Dispensing was not completed. + case abandoned = "abandoned" +} + + +/** +Why the supply item was requested + +URL: http://hl7.org/fhir/supplyrequest-reason +ValueSet: http://hl7.org/fhir/ValueSet/supplyrequest-reason +*/ +public enum SupplyRequestReason: String { + + /// The supply has been requested for use in direct patient care. + case patientCare = "patient-care" + + /// The supply has been requested for for creating or replenishing ward stock. + case wardStock = "ward-stock" +} + + +/** +Status of the supply request + +URL: http://hl7.org/fhir/supplyrequest-status +ValueSet: http://hl7.org/fhir/ValueSet/supplyrequest-status +*/ +public enum SupplyRequestStatus: String { + + /// Supply has been requested, but not dispensed. + case requested = "requested" + + /// Supply has been received by the requestor. + case completed = "completed" + + /// The supply will not be completed because the supplier was unable or unwilling to supply the item. + case failed = "failed" + + /// The orderer of the supply cancelled the request. + case cancelled = "cancelled" +} + + +/** +How to manage the intersection between a fixed version in a value set, and a fixed version of the system in the +expansion profile + +URL: http://hl7.org/fhir/system-version-processing-mode +ValueSet: http://hl7.org/fhir/ValueSet/system-version-processing-mode +*/ +public enum SystemVersionProcessingMode: String { + + /// Use this version of the code system if a value set doesn't specify a version + case `default` = "default" + + /// Use this version of the code system. If a value set specifies a different version, the expansion operation + /// should fail + case check = "check" + + /// Use this version of the code system irrespective of which version is specified by a value set. Note that this + /// has obvious safety issues, in that it may result in a value set expansion giving a different list of codes that + /// is both wrong and unsafe, and implementers should only use this capability reluctantly. It primarily exists to + /// deal with situations where specifications have fallen into decay as time passes + case override = "override" +} + + +/** +The type(s) of task performers allowed + +URL: http://hl7.org/fhir/task-performer-type +ValueSet: http://hl7.org/fhir/ValueSet/task-performer-type +*/ +public enum TaskPerformerType: String { + + /// A workflow participant that requests services. + case requester = "requester" + + /// A workflow participant that dispatches services (assigns another task to a participant). + case dispatcher = "dispatcher" + + /// A workflow participant that schedules (dispatches and sets the time or date for performance of) services. + case scheduler = "scheduler" + + /// A workflow participant that performs services. + case performer = "performer" + + /// A workflow participant that monitors task activity. + case monitor = "monitor" + + /// A workflow participant that manages task activity. + case manager = "manager" + + /// A workflow participant that acquires resources (specimens, images, etc) necessary to perform the task. + case acquirer = "acquirer" + + /// A workflow participant that reviews task inputs or outputs. + case reviewer = "reviewer" +} + + +/** +The task's priority + +URL: http://hl7.org/fhir/task-priority +ValueSet: http://hl7.org/fhir/ValueSet/task-priority +*/ +public enum TaskPriority: String { + + /// This task has low priority. + case low = "low" + + /// This task has normal priority. + case normal = "normal" + + /// This task has high priority. + case high = "high" +} + + +/** +The current status of the task. + +URL: http://hl7.org/fhir/task-status +ValueSet: http://hl7.org/fhir/ValueSet/task-status +*/ +public enum TaskStatus: String { + + /// The task is not yet ready to be acted upon. + case draft = "draft" + + /// The task is ready to be acted upon + case requested = "requested" + + /// A potential performer has claimed ownership of the task and is evaluating whether to perform it + case received = "received" + + /// The potential performer has agreed to execute the task but has not yet started work + case accepted = "accepted" + + /// The potential performer who claimed ownership of the task has decided not to execute it prior to performing any + /// action. + case rejected = "rejected" + + /// Task is ready to be performed, but no action has yet been taken. Used in place of + /// requested/received/accepted/rejected when request assignment and acceptance is a given. + case ready = "ready" + + /// Task has been started but is not yet complete. + case inProgress = "in-progress" + + /// Task has been started but work has been paused + case onHold = "on-hold" + + /// The task was attempted but could not be completed due to some error. + case failed = "failed" + + /// The task has been completed (more or less) as requested. + case completed = "completed" +} + + +/** +The type of participant. + +URL: http://hl7.org/fhir/report-participant-type +ValueSet: http://hl7.org/fhir/ValueSet/report-participant-type +*/ +public enum TestReportParticipantType: String { + + /// The test execution engine. + case testEngine = "test-engine" + + /// A FHIR Client + case client = "client" + + /// A FHIR Server + case server = "server" +} + + +/** +The results of executing an action. + +URL: http://hl7.org/fhir/report-result-codes +ValueSet: http://hl7.org/fhir/ValueSet/report-result-codes +*/ +public enum TestReportResultCodes: String { + + /// The action was successful. + case pass = "pass" + + /// The action was skipped. + case skip = "skip" + + /// The action failed. + case fail = "fail" + + /// The action passed but with warnings. + case warning = "warning" + + /// The action encountered a fatal error and the engine was unable to process. + case error = "error" +} + + +/** +The execution status of the TestReport. + +URL: http://hl7.org/fhir/report-status-codes +ValueSet: http://hl7.org/fhir/ValueSet/report-status-codes +*/ +public enum TestReportStatus: String { + + /// The TestReport is complete. + case complete = "complete" + + /// The TestReport is pending. + case pending = "pending" + + /// The TestReport failed with an error. + case error = "error" +} + + +/** +A code that indicates how transactions are supported. + +URL: http://hl7.org/fhir/transaction-mode +ValueSet: http://hl7.org/fhir/ValueSet/transaction-mode +*/ +public enum TransactionMode: String { + + /// Neither batch or transaction is supported. + case notSupported = "not-supported" + + /// Batches are supported. + case batch = "batch" + + /// Transactions are supported. + case transaction = "transaction" + + /// Both batches and transactions are supported. + case both = "both" +} + + +/** +The type of trigger + +URL: http://hl7.org/fhir/trigger-type +ValueSet: http://hl7.org/fhir/ValueSet/cqif-trigger-type +*/ +public enum TriggerType: String { + + /// The trigger occurs in response to a specific named event + case namedEvent = "named-event" + + /// The trigger occurs at a specific time or periodically as described by a timing or schedule + case periodic = "periodic" + + /// The trigger occurs whenever data of a particular type is added + case dataAdded = "data-added" + + /// The trigger occurs whenever data of a particular type is modified + case dataModified = "data-modified" + + /// The trigger occurs whenever data of a particular type is removed + case dataRemoved = "data-removed" + + /// The trigger occurs whenever data of a particular type is accessed + case dataAccessed = "data-accessed" + + /// The trigger occurs whenever access to data of a particular type is completed + case dataAccessEnded = "data-access-ended" +} + + +/** +How a type relates to it's baseDefinition. + +URL: http://hl7.org/fhir/type-derivation-rule +ValueSet: http://hl7.org/fhir/ValueSet/type-derivation-rule +*/ +public enum TypeDerivationRule: String { + + /// This definition defines a new type that adds additional elements to the base type + case specialization = "specialization" + + /// This definition adds additional rules to an existing concrete type + case constraint = "constraint" +} + + +/** +A code that indicates whether an application accepts unknown elements or extensions when reading resources. + +URL: http://hl7.org/fhir/unknown-content-code +ValueSet: http://hl7.org/fhir/ValueSet/unknown-content-code +*/ +public enum UnknownContentCode: String { + + /// The application does not accept either unknown elements or extensions. + case no = "no" + + /// The application accepts unknown extensions, but not unknown elements. + case extensions = "extensions" + + /// The application accepts unknown elements, but not unknown extensions. + case elements = "elements" + + /// The application accepts unknown elements and extensions. + case both = "both" +} + + +/** +A code the specifies a type of context being specified by a usage context + +URL: http://hl7.org/fhir/usage-context-type +ValueSet: http://hl7.org/fhir/ValueSet/usage-context-type +*/ +public enum UsageContextType: String { + + /// The gender of the patient. For this context type, the value should be a code taken from the + /// [AdministrativeGender](valueset-administrative-gender.html) value set + case gender = "gender" + + /// The age of the patient. For this context type, the value should be a range the specifies the applicable ages or + /// a code from the MeSH value set AgeGroupObservationValue + case age = "age" + + /// The clinical concept(s) addressed by the artifact. For example, disease, diagnostic test interpretation, + /// medication ordering. + case focus = "focus" + + /// The clinical speciality of the context in which the patient is bring treated - For example, PCP, Patient, + /// Cardiologist, Behavioral Professional, Oral Health Professional, Prescriber, etc... taken from the NUCC Health + /// Care provider taxonomyCode system (OID: 2.16.840.1.113883.6.101). + case user = "user" + + /// The settings in which the artifact is intended for use. For example, admission, pre-op, etc + case workflow = "workflow" + + /// The context for the clinical task(s) represented by this artifact. Can be any task context represented by the + /// HL7 ActTaskCode value set (OID: 2.16.840.1.113883.1.11.19846). General categories include: order entry, patient + /// documentation and patient information review. + case task = "task" + + /// The venue in which an artifact could be used. For example, Outpatient, Inpatient, Home, Nursing home. The code + /// value may originate from either the HL7 ActEncounter (OID: 2.16.840.1.113883.1.11.13955) or NUCC non-individual + /// provider codes OID: 2.16.840.1.113883.1.11.19465. + case venue = "venue" +} + + +/** +Complete, proposed, exploratory, other + +URL: http://hl7.org/fhir/claim-use +ValueSet: http://hl7.org/fhir/ValueSet/claim-use +*/ +public enum Use: String { + + /// The treatment is complete and this represents a Claim for the services. + case complete = "complete" + + /// The treatment is proposed and this represents a Pre-authorization for the services. + case proposed = "proposed" + + /// The treatment is proposed and this represents a Pre-determination for the services. + case exploratory = "exploratory" + + /// A locally defined or otherwise resolved status. + case other = "other" +} + + +/** +A coded concept listing the base codes. + +URL: http://hl7.org/fhir/vision-base-codes +ValueSet: http://hl7.org/fhir/ValueSet/vision-base-codes +*/ +public enum VisionBase: String { + + /// top + case up = "up" + + /// bottom + case down = "down" + + /// inner edge + case `in` = "in" + + /// outer edge + case out = "out" +} + + +/** +A coded concept listing the eye codes. + +URL: http://hl7.org/fhir/vision-eye-codes +ValueSet: http://hl7.org/fhir/ValueSet/vision-eye-codes +*/ +public enum VisionEyes: String { + + /// Right Eye + case right = "right" + + /// Left Eye + case left = "left" +} + + +/** +A code specifying the state of the resource instance. + +URL: http://hl7.org/fhir/vision-status +ValueSet: http://hl7.org/fhir/ValueSet/vision-status +*/ +public enum VisionStatus: String { + + /// The resource instance is currently in-force. + case active = "active" + + /// The resource instance is withdrawn, rescinded or reversed. + case cancelled = "cancelled" + + /// A new resource instance the contents of which is not complete. + case draft = "draft" + + /// The resource instance was entered in error. + case enteredInError = "entered-in-error" +} + + +/** +The kind of relationship between two XDS documents. + +URL: http://hl7.org/fhir/xds-relationship-type +ValueSet: http://hl7.org/fhir/ValueSet/xds-relationship-type +*/ +public enum XDSRelationshipType: String { + + /// A separate XDS document that references a prior document, and may extend or alter the observations in the prior + /// document. + case APND = "APND" + + /// A new version of an existing document. + case RPLC = "RPLC" + + /// A transformed document is derived by a machine translation from some other format. + case XFRM = "XFRM" + + /// Both a XFRM and a RPLC relationship. + case XFRM_RPLC = "XFRM_RPLC" + + /// This document signs the target document. + case signs = "signs" +} + + +/** +How a search parameter relates to the set of elements returned by evaluating its xpath query. + +URL: http://hl7.org/fhir/search-xpath-usage +ValueSet: http://hl7.org/fhir/ValueSet/search-xpath-usage +*/ +public enum XPathUsageType: String { + + /// The search parameter is derived directly from the selected nodes based on the type definitions. + case normal = "normal" + + /// The search parameter is derived by a phonetic transform from the selected nodes. + case phonetic = "phonetic" + + /// The search parameter is based on a spatial transform of the selected nodes. + case nearby = "nearby" + + /// The search parameter is based on a spatial transform of the selected nodes, using physical distance from the + /// middle. + case distance = "distance" + + /// The interpretation of the xpath statement is unknown (and can't be automated). + case other = "other" +} + diff --git a/Sources/Models/CodeableConcept.swift b/Sources/Models/CodeableConcept.swift index fb4b89a7..48833e1a 100644 --- a/Sources/Models/CodeableConcept.swift +++ b/Sources/Models/CodeableConcept.swift @@ -2,7 +2,7 @@ // CodeableConcept.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/CodeableConcept) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/CodeableConcept) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Concept - reference to a terminology or just text. - * - * A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. - */ +Concept - reference to a terminology or just text. + +A concept that may be defined by a formal reference to a terminology or ontology or may be provided by text. +*/ open class CodeableConcept: Element { override open class var resourceType: String { get { return "CodeableConcept" } diff --git a/Sources/Models/Coding.swift b/Sources/Models/Coding.swift index e85491ca..4235d100 100644 --- a/Sources/Models/Coding.swift +++ b/Sources/Models/Coding.swift @@ -2,7 +2,7 @@ // Coding.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Coding) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Coding) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,8 +10,8 @@ import Foundation /** - * A reference to a code defined by a terminology system. - */ +A reference to a code defined by a terminology system. +*/ open class Coding: Element { override open class var resourceType: String { get { return "Coding" } diff --git a/Sources/Models/Communication.swift b/Sources/Models/Communication.swift index ba8d1415..69bccffa 100644 --- a/Sources/Models/Communication.swift +++ b/Sources/Models/Communication.swift @@ -2,7 +2,7 @@ // Communication.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Communication) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Communication) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * A record of information transmitted from a sender to a receiver. - * - * An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public - * health agency was notified about a reportable condition. - */ +A record of information transmitted from a sender to a receiver. + +An occurrence of information being transmitted; e.g. an alert that was sent to a responsible provider, a public health +agency was notified about a reportable condition. +*/ open class Communication: DomainResource { override open class var resourceType: String { get { return "Communication" } @@ -59,8 +59,8 @@ open class Communication: DomainResource { /// When sent. public var sent: DateTime? - /// in-progress | completed | suspended | rejected | failed. - public var status: String? + /// The status of the transmission. + public var status: CommunicationStatus? /// Focus of message. public var subject: Reference? @@ -246,7 +246,12 @@ open class Communication: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = CommunicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -326,7 +331,7 @@ open class Communication: DomainResource { json["sent"] = sent.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) @@ -341,10 +346,10 @@ open class Communication: DomainResource { /** - * Message payload. - * - * Text, attachment(s), or resource(s) that was communicated to the recipient. - */ +Message payload. + +Text, attachment(s), or resource(s) that was communicated to the recipient. +*/ open class CommunicationPayload: BackboneElement { override open class var resourceType: String { get { return "CommunicationPayload" } diff --git a/Sources/Models/CommunicationRequest.swift b/Sources/Models/CommunicationRequest.swift index 2884887c..cbac10e6 100644 --- a/Sources/Models/CommunicationRequest.swift +++ b/Sources/Models/CommunicationRequest.swift @@ -2,7 +2,7 @@ // CommunicationRequest.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/CommunicationRequest) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/CommunicationRequest) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * A request for information to be sent to a receiver. - * - * A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the - * CDS system proposes that the public health agency be notified about a reportable condition. - */ +A request for information to be sent to a receiver. + +A request to convey information; e.g. the CDS system proposes that an alert be sent to a responsible provider, the CDS +system proposes that the public health agency be notified about a reportable condition. +*/ open class CommunicationRequest: DomainResource { override open class var resourceType: String { get { return "CommunicationRequest" } @@ -23,8 +23,8 @@ open class CommunicationRequest: DomainResource { /// Message category. public var category: CodeableConcept? - /// Encounter leading to message. - public var encounter: Reference? + /// Encounter or episode leading to message. + public var context: Reference? /// Unique identifier. public var identifier: [Identifier]? @@ -59,12 +59,15 @@ open class CommunicationRequest: DomainResource { /// Message sender. public var sender: Reference? - /// proposed | planned | requested | received | accepted | in-progress | completed | suspended | rejected | failed. - public var status: String? + /// The status of the proposal or order. + public var status: CommunicationRequestStatus? /// Focus of message. public var subject: Reference? + /// Focal resources. + public var topic: [Reference]? + override open func populate(from json: FHIRJSON, presentKeys: inout Set) throws -> [FHIRValidationError]? { var errors = try super.populate(from: json, presentKeys: &presentKeys) ?? [FHIRValidationError]() @@ -82,18 +85,18 @@ open class CommunicationRequest: DomainResource { errors.append(FHIRValidationError(key: "category", wants: FHIRJSON.self, has: type(of: exist))) } } - if let exist = json["encounter"] { - presentKeys.insert("encounter") + if let exist = json["context"] { + presentKeys.insert("context") if let val = exist as? FHIRJSON { do { - self.encounter = try Reference(json: val, owner: self) + self.context = try Reference(json: val, owner: self) } catch let error as FHIRValidationError { - errors.append(error.prefixed(with: "encounter")) + errors.append(error.prefixed(with: "context")) } } else { - errors.append(FHIRValidationError(key: "encounter", wants: FHIRJSON.self, has: type(of: exist))) + errors.append(FHIRValidationError(key: "context", wants: FHIRJSON.self, has: type(of: exist))) } } if let exist = json["identifier"] { @@ -243,7 +246,12 @@ open class CommunicationRequest: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = CommunicationRequestStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -263,6 +271,20 @@ open class CommunicationRequest: DomainResource { errors.append(FHIRValidationError(key: "subject", wants: FHIRJSON.self, has: type(of: exist))) } } + if let exist = json["topic"] { + presentKeys.insert("topic") + if let val = exist as? [FHIRJSON] { + do { + self.topic = try Reference.instantiate(fromArray: val, owner: self) as? [Reference] + } + catch let error as FHIRValidationError { + errors.append(error.prefixed(with: "topic")) + } + } + else { + errors.append(FHIRValidationError(key: "topic", wants: Array.self, has: type(of: exist))) + } + } return errors.isEmpty ? nil : errors } @@ -272,8 +294,8 @@ open class CommunicationRequest: DomainResource { if let category = self.category { json["category"] = category.asJSON(errors: &errors) } - if let encounter = self.encounter { - json["encounter"] = encounter.asJSON(errors: &errors) + if let context = self.context { + json["context"] = context.asJSON(errors: &errors) } if let identifier = self.identifier { json["identifier"] = identifier.map() { $0.asJSON(errors: &errors) } @@ -309,11 +331,14 @@ open class CommunicationRequest: DomainResource { json["sender"] = sender.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) } + if let topic = self.topic { + json["topic"] = topic.map() { $0.asJSON(errors: &errors) } + } return json } @@ -321,10 +346,10 @@ open class CommunicationRequest: DomainResource { /** - * Message payload. - * - * Text, attachment(s), or resource(s) to be communicated to the recipient. - */ +Message payload. + +Text, attachment(s), or resource(s) to be communicated to the recipient. +*/ open class CommunicationRequestPayload: BackboneElement { override open class var resourceType: String { get { return "CommunicationRequestPayload" } diff --git a/Sources/Models/CompartmentDefinition.swift b/Sources/Models/CompartmentDefinition.swift index 4e1368b5..8c6a43bf 100644 --- a/Sources/Models/CompartmentDefinition.swift +++ b/Sources/Models/CompartmentDefinition.swift @@ -2,7 +2,7 @@ // CompartmentDefinition.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/CompartmentDefinition) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/CompartmentDefinition) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,17 +10,17 @@ import Foundation /** - * Compartment Definition for a resource. - * - * A compartment definition that defines how resources are accessed on a server. - */ +Compartment Definition for a resource. + +A compartment definition that defines how resources are accessed on a server. +*/ open class CompartmentDefinition: DomainResource { override open class var resourceType: String { get { return "CompartmentDefinition" } } - /// Patient | Encounter | RelatedPerson | Practitioner | Device. - public var code: String? + /// Which compartment this definition describes. + public var code: CompartmentType? /// Contact details for the publisher. public var contact: [ContactDetail]? @@ -52,8 +52,8 @@ open class CompartmentDefinition: DomainResource { /// Whether the search syntax is supported. public var search: Bool? - /// draft | active | retired. - public var status: String? + /// The status of this compartment definition. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Name for this compartment definition (Human friendly). public var title: String? @@ -66,7 +66,7 @@ open class CompartmentDefinition: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(code: String, name: String, search: Bool, status: String, url: URL) { + public convenience init(code: CompartmentType, name: String, search: Bool, status: PublicationStatus, url: URL) { self.init() self.code = code self.name = name @@ -81,7 +81,12 @@ open class CompartmentDefinition: DomainResource { if let exist = json["code"] { presentKeys.insert("code") if let val = exist as? String { - self.code = val + if let enumval = CompartmentType(rawValue: val) { + self.code = enumval + } + else { + errors.append(FHIRValidationError(key: "code", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "code", wants: String.self, has: type(of: exist))) @@ -204,7 +209,12 @@ open class CompartmentDefinition: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -255,7 +265,7 @@ open class CompartmentDefinition: DomainResource { var json = super.asJSON(errors: &errors) if let code = self.code { - json["code"] = code.asJSON() + json["code"] = code.rawValue } if let contact = self.contact { json["contact"] = contact.map() { $0.asJSON(errors: &errors) } @@ -288,7 +298,7 @@ open class CompartmentDefinition: DomainResource { json["search"] = search.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let title = self.title { json["title"] = title.asJSON() @@ -306,10 +316,10 @@ open class CompartmentDefinition: DomainResource { /** - * How resource is related to the compartment. - * - * Information about how a resource it related to the compartment. - */ +How resource is related to the compartment. + +Information about how a resource it related to the compartment. +*/ open class CompartmentDefinitionResource: BackboneElement { override open class var resourceType: String { get { return "CompartmentDefinitionResource" } @@ -377,11 +387,7 @@ open class CompartmentDefinitionResource: BackboneElement { json["documentation"] = documentation.asJSON() } if let param = self.param { - var arr = [Any]() - for val in param { - arr.append(val.asJSON()) - } - json["param"] = arr + json["param"] = param.map() { $0.asJSON() } } return json diff --git a/Sources/Models/Composition.swift b/Sources/Models/Composition.swift index 1af32337..a125732c 100644 --- a/Sources/Models/Composition.swift +++ b/Sources/Models/Composition.swift @@ -2,7 +2,7 @@ // Composition.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Composition) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Composition) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,28 +10,27 @@ import Foundation /** - * A set of resources composed into a single coherent clinical statement with clinical attestation. - * - * A set of healthcare-related information that is assembled together into a single logical document that provides a - * single coherent statement of meaning, establishes its own context and that has clinical attestation with regard to - * who is making the statement. While a Composition defines the structure, it does not actually contain the content: - * rather the full content of a document is contained in a Bundle, of which the Composition is the first resource - * contained. - */ +A set of resources composed into a single coherent clinical statement with clinical attestation. + +A set of healthcare-related information that is assembled together into a single logical document that provides a single +coherent statement of meaning, establishes its own context and that has clinical attestation with regard to who is +making the statement. While a Composition defines the structure, it does not actually contain the content: rather the +full content of a document is contained in a Bundle, of which the Composition is the first resource contained. +*/ open class Composition: DomainResource { override open class var resourceType: String { get { return "Composition" } } + /// Categorization of Composition. + public var `class`: CodeableConcept? + /// Attests to accuracy of composition. public var attester: [CompositionAttester]? /// Who and/or what authored the composition. public var author: [Reference]? - /// Categorization of Composition. - public var class_fhir: CodeableConcept? - /// As defined by affinity domain. public var confidentiality: String? @@ -53,8 +52,9 @@ open class Composition: DomainResource { /// Composition is broken into sections. public var section: [CompositionSection]? - /// preliminary | final | amended | entered-in-error. - public var status: String? + /// The workflow/clinical status of this composition. The status is a marker for the clinical standing of the + /// document. + public var status: CompositionStatus? /// Who and/or what the composition is about. public var subject: Reference? @@ -67,7 +67,7 @@ open class Composition: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(author: [Reference], date: DateTime, status: String, subject: Reference, title: String, type: CodeableConcept) { + public convenience init(author: [Reference], date: DateTime, status: CompositionStatus, subject: Reference, title: String, type: CodeableConcept) { self.init() self.author = author self.date = date @@ -80,6 +80,20 @@ open class Composition: DomainResource { override open func populate(from json: FHIRJSON, presentKeys: inout Set) throws -> [FHIRValidationError]? { var errors = try super.populate(from: json, presentKeys: &presentKeys) ?? [FHIRValidationError]() + if let exist = json["class"] { + presentKeys.insert("class") + if let val = exist as? FHIRJSON { + do { + self.`class` = try CodeableConcept(json: val, owner: self) + } + catch let error as FHIRValidationError { + errors.append(error.prefixed(with: "class")) + } + } + else { + errors.append(FHIRValidationError(key: "class", wants: FHIRJSON.self, has: type(of: exist))) + } + } if let exist = json["attester"] { presentKeys.insert("attester") if let val = exist as? [FHIRJSON] { @@ -111,20 +125,6 @@ open class Composition: DomainResource { else { errors.append(FHIRValidationError(missing: "author")) } - if let exist = json["class"] { - presentKeys.insert("class") - if let val = exist as? FHIRJSON { - do { - self.class_fhir = try CodeableConcept(json: val, owner: self) - } - catch let error as FHIRValidationError { - errors.append(error.prefixed(with: "class")) - } - } - else { - errors.append(FHIRValidationError(key: "class", wants: FHIRJSON.self, has: type(of: exist))) - } - } if let exist = json["confidentiality"] { presentKeys.insert("confidentiality") if let val = exist as? String { @@ -219,7 +219,12 @@ open class Composition: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = CompositionStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -280,15 +285,15 @@ open class Composition: DomainResource { override open func asJSON(errors: inout [FHIRValidationError]) -> FHIRJSON { var json = super.asJSON(errors: &errors) + if let `class` = self.`class` { + json["class"] = `class`.asJSON(errors: &errors) + } if let attester = self.attester { json["attester"] = attester.map() { $0.asJSON(errors: &errors) } } if let author = self.author { json["author"] = author.map() { $0.asJSON(errors: &errors) } } - if let class_fhir = self.class_fhir { - json["class"] = class_fhir.asJSON(errors: &errors) - } if let confidentiality = self.confidentiality { json["confidentiality"] = confidentiality.asJSON() } @@ -311,7 +316,7 @@ open class Composition: DomainResource { json["section"] = section.map() { $0.asJSON(errors: &errors) } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) @@ -329,17 +334,17 @@ open class Composition: DomainResource { /** - * Attests to accuracy of composition. - * - * A participant who has attested to the accuracy of the composition/document. - */ +Attests to accuracy of composition. + +A participant who has attested to the accuracy of the composition/document. +*/ open class CompositionAttester: BackboneElement { override open class var resourceType: String { get { return "CompositionAttester" } } - /// personal | professional | legal | official. - public var mode: [String]? + /// The type of attestation the authenticator offers. + public var mode: [CompositionAttestationMode]? /// Who attested the composition. public var party: Reference? @@ -349,7 +354,7 @@ open class CompositionAttester: BackboneElement { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(mode: [String]) { + public convenience init(mode: [CompositionAttestationMode]) { self.init() self.mode = mode } @@ -359,8 +364,12 @@ open class CompositionAttester: BackboneElement { var errors = try super.populate(from: json, presentKeys: &presentKeys) ?? [FHIRValidationError]() if let exist = json["mode"] { presentKeys.insert("mode") - if let val = exist as? [String] { - self.mode = val + if let val = exist as? [String] { var i = -1 + self.mode = val.map() { i += 1 + if let enumval = CompositionAttestationMode(rawValue: $0) { return enumval } + errors.append(FHIRValidationError(key: "mode.\(i)", problem: "the value “\(val)” is not valid")) + return nil + }.filter() { nil != $0 }.map() { $0! } } else { errors.append(FHIRValidationError(key: "mode", wants: Array.self, has: type(of: exist))) @@ -399,11 +408,7 @@ open class CompositionAttester: BackboneElement { var json = super.asJSON(errors: &errors) if let mode = self.mode { - var arr = [Any]() - for val in mode { - arr.append(val.asJSON()) - } - json["mode"] = arr + json["mode"] = mode.map() { $0.rawValue } } if let party = self.party { json["party"] = party.asJSON(errors: &errors) @@ -418,10 +423,10 @@ open class CompositionAttester: BackboneElement { /** - * The clinical service(s) being documented. - * - * The clinical service, such as a colonoscopy or an appendectomy, being documented. - */ +The clinical service(s) being documented. + +The clinical service, such as a colonoscopy or an appendectomy, being documented. +*/ open class CompositionEvent: BackboneElement { override open class var resourceType: String { get { return "CompositionEvent" } @@ -503,10 +508,10 @@ open class CompositionEvent: BackboneElement { /** - * Composition is broken into sections. - * - * The root of the sections that make up the composition. - */ +Composition is broken into sections. + +The root of the sections that make up the composition. +*/ open class CompositionSection: BackboneElement { override open class var resourceType: String { get { return "CompositionSection" } @@ -521,8 +526,10 @@ open class CompositionSection: BackboneElement { /// A reference to data that supports this section. public var entry: [Reference]? - /// working | snapshot | changes. - public var mode: String? + /// How the entry list was prepared - whether it is a working list that is suitable for being maintained on an + /// ongoing basis, or if it represents a snapshot of a list of items from another source, or whether it is a + /// prepared list where items may be marked as added, modified or deleted. + public var mode: ListMode? /// Order of section entries. public var orderedBy: CodeableConcept? @@ -584,7 +591,12 @@ open class CompositionSection: BackboneElement { if let exist = json["mode"] { presentKeys.insert("mode") if let val = exist as? String { - self.mode = val + if let enumval = ListMode(rawValue: val) { + self.mode = enumval + } + else { + errors.append(FHIRValidationError(key: "mode", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "mode", wants: String.self, has: type(of: exist))) @@ -657,7 +669,7 @@ open class CompositionSection: BackboneElement { json["entry"] = entry.map() { $0.asJSON(errors: &errors) } } if let mode = self.mode { - json["mode"] = mode.asJSON() + json["mode"] = mode.rawValue } if let orderedBy = self.orderedBy { json["orderedBy"] = orderedBy.asJSON(errors: &errors) diff --git a/Sources/Models/ConceptMap.swift b/Sources/Models/ConceptMap.swift index a52176ab..ba566eb5 100644 --- a/Sources/Models/ConceptMap.swift +++ b/Sources/Models/ConceptMap.swift @@ -2,7 +2,7 @@ // ConceptMap.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ConceptMap) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ConceptMap) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * A map from one set of concepts to one or more other concepts. - * - * A statement of relationships from one set of concepts to one or more other concepts - either code systems or data - * elements, or classes in class models. - */ +A map from one set of concepts to one or more other concepts. + +A statement of relationships from one set of concepts to one or more other concepts - either code systems or data +elements, or classes in class models. +*/ open class ConceptMap: DomainResource { override open class var resourceType: String { get { return "ConceptMap" } @@ -59,8 +59,8 @@ open class ConceptMap: DomainResource { /// Identifies the source of the concepts which are being mapped. public var sourceUri: URL? - /// draft | active | retired. - public var status: String? + /// The status of this concept map. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Provides context to the mappings. public var targetReference: Reference? @@ -82,7 +82,7 @@ open class ConceptMap: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(source: Any, status: String, target: Any) { + public convenience init(source: Any, status: PublicationStatus, target: Any) { self.init() if let value = source as? URL { self.sourceUri = value @@ -253,7 +253,12 @@ open class ConceptMap: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -380,7 +385,7 @@ open class ConceptMap: DomainResource { json["sourceUri"] = sourceUri.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let targetReference = self.targetReference { json["targetReference"] = targetReference.asJSON(errors: &errors) @@ -407,10 +412,10 @@ open class ConceptMap: DomainResource { /** - * Same source and target systems. - * - * A group of mappings that all have the same source and target system. - */ +Same source and target systems. + +A group of mappings that all have the same source and target system. +*/ open class ConceptMapGroup: BackboneElement { override open class var resourceType: String { get { return "ConceptMapGroup" } @@ -526,10 +531,10 @@ open class ConceptMapGroup: BackboneElement { /** - * Mappings for a concept from the source set. - * - * Mappings for an individual concept in the source to one or more concepts in the target. - */ +Mappings for a concept from the source set. + +Mappings for an individual concept in the source to one or more concepts in the target. +*/ open class ConceptMapGroupElement: BackboneElement { override open class var resourceType: String { get { return "ConceptMapGroupElement" } @@ -586,10 +591,10 @@ open class ConceptMapGroupElement: BackboneElement { /** - * Concept in target system for element. - * - * A concept from the target value set that this concept maps to. - */ +Concept in target system for element. + +A concept from the target value set that this concept maps to. +*/ open class ConceptMapGroupElementTarget: BackboneElement { override open class var resourceType: String { get { return "ConceptMapGroupElementTarget" } @@ -604,8 +609,9 @@ open class ConceptMapGroupElementTarget: BackboneElement { /// Other elements required for this mapping (from context). public var dependsOn: [ConceptMapGroupElementTargetDependsOn]? - /// relatedto | equivalent | equal | wider | subsumes | narrower | specializes | inexact | unmatched | disjoint. - public var equivalence: String? + /// The equivalence between the source and target concepts (counting for the dependencies and products). The + /// equivalence is read from target to source (e.g. the target is 'wider' than the source). + public var equivalence: ConceptMapEquivalence? /// Other concepts that this mapping also produces. public var product: [ConceptMapGroupElementTargetDependsOn]? @@ -648,7 +654,12 @@ open class ConceptMapGroupElementTarget: BackboneElement { if let exist = json["equivalence"] { presentKeys.insert("equivalence") if let val = exist as? String { - self.equivalence = val + if let enumval = ConceptMapEquivalence(rawValue: val) { + self.equivalence = enumval + } + else { + errors.append(FHIRValidationError(key: "equivalence", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "equivalence", wants: String.self, has: type(of: exist))) @@ -684,7 +695,7 @@ open class ConceptMapGroupElementTarget: BackboneElement { json["dependsOn"] = dependsOn.map() { $0.asJSON(errors: &errors) } } if let equivalence = self.equivalence { - json["equivalence"] = equivalence.asJSON() + json["equivalence"] = equivalence.rawValue } if let product = self.product { json["product"] = product.map() { $0.asJSON(errors: &errors) } @@ -696,11 +707,11 @@ open class ConceptMapGroupElementTarget: BackboneElement { /** - * Other elements required for this mapping (from context). - * - * A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element - * can be resolved, and it has the specified value. - */ +Other elements required for this mapping (from context). + +A set of additional dependencies for this mapping to hold. This mapping is only applicable if the specified element can +be resolved, and it has the specified value. +*/ open class ConceptMapGroupElementTargetDependsOn: BackboneElement { override open class var resourceType: String { get { return "ConceptMapGroupElementTargetDependsOn" } diff --git a/Sources/Models/Condition.swift b/Sources/Models/Condition.swift index b3bbb43e..d23b9e38 100644 --- a/Sources/Models/Condition.swift +++ b/Sources/Models/Condition.swift @@ -2,7 +2,7 @@ // Condition.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Condition) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Condition) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,12 +10,12 @@ import Foundation /** - * Detailed information about conditions, problems or diagnoses. - * - * Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many - * uses including: recording a diagnosis during an encounter; populating a problem list or a summary statement, such as - * a discharge summary. - */ +Detailed information about conditions, problems or diagnoses. + +Use to record detailed information about conditions, problems or diagnoses recognized by a clinician. There are many +uses including: recording a diagnosis during an encounter; populating a problem list or a summary statement, such as a +discharge summary. +*/ open class Condition: DomainResource { override open class var resourceType: String { get { return "Condition" } @@ -93,12 +93,12 @@ open class Condition: DomainResource { /// Who has the condition?. public var subject: Reference? - /// provisional | differential | confirmed | refuted | entered-in-error | unknown. - public var verificationStatus: String? + /// The verification status to support the clinical status of the condition. + public var verificationStatus: ConditionVerificationStatus? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(code: CodeableConcept, subject: Reference, verificationStatus: String) { + public convenience init(code: CodeableConcept, subject: Reference, verificationStatus: ConditionVerificationStatus) { self.init() self.code = code self.subject = subject @@ -418,7 +418,12 @@ open class Condition: DomainResource { if let exist = json["verificationStatus"] { presentKeys.insert("verificationStatus") if let val = exist as? String { - self.verificationStatus = val + if let enumval = ConditionVerificationStatus(rawValue: val) { + self.verificationStatus = enumval + } + else { + errors.append(FHIRValidationError(key: "verificationStatus", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "verificationStatus", wants: String.self, has: type(of: exist))) @@ -506,7 +511,7 @@ open class Condition: DomainResource { json["subject"] = subject.asJSON(errors: &errors) } if let verificationStatus = self.verificationStatus { - json["verificationStatus"] = verificationStatus.asJSON() + json["verificationStatus"] = verificationStatus.rawValue } return json @@ -515,10 +520,10 @@ open class Condition: DomainResource { /** - * Supporting evidence. - * - * Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed. - */ +Supporting evidence. + +Supporting Evidence / manifestations that are the basis on which this condition is suspected or confirmed. +*/ open class ConditionEvidence: BackboneElement { override open class var resourceType: String { get { return "ConditionEvidence" } @@ -580,10 +585,10 @@ open class ConditionEvidence: BackboneElement { /** - * Stage/grade, usually assessed formally. - * - * Clinical stage or grade of a condition. May include formal severity assessments. - */ +Stage/grade, usually assessed formally. + +Clinical stage or grade of a condition. May include formal severity assessments. +*/ open class ConditionStage: BackboneElement { override open class var resourceType: String { get { return "ConditionStage" } diff --git a/Sources/Models/Consent.swift b/Sources/Models/Consent.swift index 397dcfc6..278e706c 100644 --- a/Sources/Models/Consent.swift +++ b/Sources/Models/Consent.swift @@ -2,7 +2,7 @@ // Consent.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Consent) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Consent) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,12 +10,12 @@ import Foundation /** - * A healthcare consumer’s policy choices to permits or denies recipients or roles to perform actions for specific - * purposes and periods of time. - * - * A record of a healthcare consumer’s policy choices, which permits or denies identified recipient(s) or recipient - * role(s) to perform one or more actions within a given policy context, for specific purposes and periods of time. - */ +A healthcare consumer’s policy choices to permits or denies recipients or roles to perform actions for specific purposes +and periods of time. + +A record of a healthcare consumer’s policy choices, which permits or denies identified recipient(s) or recipient role(s) +to perform one or more actions within a given policy context, for specific purposes and periods of time. +*/ open class Consent: DomainResource { override open class var resourceType: String { get { return "Consent" } @@ -63,12 +63,12 @@ open class Consent: DomainResource { /// Source from which this consent is taken. public var sourceReference: Reference? - /// draft | proposed | active | rejected | inactive | entered-in-error. - public var status: String? + /// Indicates the current state of this consent. + public var status: ConsentStatus? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(patient: Reference, policy: URL, status: String) { + public convenience init(patient: Reference, policy: URL, status: ConsentStatus) { self.init() self.patient = patient self.policy = policy @@ -273,7 +273,12 @@ open class Consent: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = ConsentStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -331,7 +336,7 @@ open class Consent: DomainResource { json["sourceReference"] = sourceReference.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } return json @@ -340,24 +345,24 @@ open class Consent: DomainResource { /** - * Additional rule - addition or removal of permissions. - * - * An exception to the base policy of this consent. An exception can be an addition or removal of access permissions. - */ +Additional rule - addition or removal of permissions. + +An exception to the base policy of this consent. An exception can be an addition or removal of access permissions. +*/ open class ConsentExcept: BackboneElement { override open class var resourceType: String { get { return "ConsentExcept" } } + /// e.g. Resource Type, Profile, or CDA etc. + public var `class`: [Coding]? + /// Actions controlled by this exception. public var action: [CodeableConcept]? /// Who|what controlled by this exception (or group, by role). public var actor: [ConsentExceptActor]? - /// e.g. Resource Type, Profile, or CDA etc. - public var class_fhir: [Coding]? - /// e.g. LOINC or SNOMED CT code, etc in the content. public var code: [Coding]? @@ -373,12 +378,12 @@ open class ConsentExcept: BackboneElement { /// Security Labels that define affected resources. public var securityLabel: [Coding]? - /// deny | permit. - public var type: String? + /// Action to take - permit or deny - when the exception conditions are met. + public var type: ConsentExceptType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(type: String) { + public convenience init(type: ConsentExceptType) { self.init() self.type = type } @@ -386,6 +391,20 @@ open class ConsentExcept: BackboneElement { override open func populate(from json: FHIRJSON, presentKeys: inout Set) throws -> [FHIRValidationError]? { var errors = try super.populate(from: json, presentKeys: &presentKeys) ?? [FHIRValidationError]() + if let exist = json["class"] { + presentKeys.insert("class") + if let val = exist as? [FHIRJSON] { + do { + self.`class` = try Coding.instantiate(fromArray: val, owner: self) as? [Coding] + } + catch let error as FHIRValidationError { + errors.append(error.prefixed(with: "class")) + } + } + else { + errors.append(FHIRValidationError(key: "class", wants: Array.self, has: type(of: exist))) + } + } if let exist = json["action"] { presentKeys.insert("action") if let val = exist as? [FHIRJSON] { @@ -414,20 +433,6 @@ open class ConsentExcept: BackboneElement { errors.append(FHIRValidationError(key: "actor", wants: Array.self, has: type(of: exist))) } } - if let exist = json["class"] { - presentKeys.insert("class") - if let val = exist as? [FHIRJSON] { - do { - self.class_fhir = try Coding.instantiate(fromArray: val, owner: self) as? [Coding] - } - catch let error as FHIRValidationError { - errors.append(error.prefixed(with: "class")) - } - } - else { - errors.append(FHIRValidationError(key: "class", wants: Array.self, has: type(of: exist))) - } - } if let exist = json["code"] { presentKeys.insert("code") if let val = exist as? [FHIRJSON] { @@ -501,7 +506,12 @@ open class ConsentExcept: BackboneElement { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = ConsentExceptType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -516,15 +526,15 @@ open class ConsentExcept: BackboneElement { override open func asJSON(errors: inout [FHIRValidationError]) -> FHIRJSON { var json = super.asJSON(errors: &errors) + if let `class` = self.`class` { + json["class"] = `class`.map() { $0.asJSON(errors: &errors) } + } if let action = self.action { json["action"] = action.map() { $0.asJSON(errors: &errors) } } if let actor = self.actor { json["actor"] = actor.map() { $0.asJSON(errors: &errors) } } - if let class_fhir = self.class_fhir { - json["class"] = class_fhir.map() { $0.asJSON(errors: &errors) } - } if let code = self.code { json["code"] = code.map() { $0.asJSON(errors: &errors) } } @@ -541,7 +551,7 @@ open class ConsentExcept: BackboneElement { json["securityLabel"] = securityLabel.map() { $0.asJSON(errors: &errors) } } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json @@ -550,11 +560,11 @@ open class ConsentExcept: BackboneElement { /** - * Who|what controlled by this exception (or group, by role). - * - * Who or what is controlled by this Exception. Use group to identify a set of actors by some property they share (e.g. - * 'admitting officers'). - */ +Who|what controlled by this exception (or group, by role). + +Who or what is controlled by this Exception. Use group to identify a set of actors by some property they share (e.g. +'admitting officers'). +*/ open class ConsentExceptActor: BackboneElement { override open class var resourceType: String { get { return "ConsentExceptActor" } @@ -630,24 +640,24 @@ open class ConsentExceptActor: BackboneElement { /** - * Data controlled by this exception. - * - * The resources controlled by this exception, if specific resources are referenced. - */ +Data controlled by this exception. + +The resources controlled by this exception, if specific resources are referenced. +*/ open class ConsentExceptData: BackboneElement { override open class var resourceType: String { get { return "ConsentExceptData" } } - /// instance | related | dependents. - public var meaning: String? + /// How the resource reference is interpreted when testing consent restrictions. + public var meaning: ConsentDataMeaning? /// The actual data reference. public var reference: Reference? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(meaning: String, reference: Reference) { + public convenience init(meaning: ConsentDataMeaning, reference: Reference) { self.init() self.meaning = meaning self.reference = reference @@ -659,7 +669,12 @@ open class ConsentExceptData: BackboneElement { if let exist = json["meaning"] { presentKeys.insert("meaning") if let val = exist as? String { - self.meaning = val + if let enumval = ConsentDataMeaning(rawValue: val) { + self.meaning = enumval + } + else { + errors.append(FHIRValidationError(key: "meaning", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "meaning", wants: String.self, has: type(of: exist))) @@ -692,7 +707,7 @@ open class ConsentExceptData: BackboneElement { var json = super.asJSON(errors: &errors) if let meaning = self.meaning { - json["meaning"] = meaning.asJSON() + json["meaning"] = meaning.rawValue } if let reference = self.reference { json["reference"] = reference.asJSON(errors: &errors) diff --git a/Sources/Models/ContactDetail.swift b/Sources/Models/ContactDetail.swift index 79616a82..608df073 100644 --- a/Sources/Models/ContactDetail.swift +++ b/Sources/Models/ContactDetail.swift @@ -2,7 +2,7 @@ // ContactDetail.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ContactDetail) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ContactDetail) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Contact information. - * - * Specifies contact information for a person or organization. - */ +Contact information. + +Specifies contact information for a person or organization. +*/ open class ContactDetail: Element { override open class var resourceType: String { get { return "ContactDetail" } diff --git a/Sources/Models/ContactPoint.swift b/Sources/Models/ContactPoint.swift index 4cce23ce..97791fa7 100644 --- a/Sources/Models/ContactPoint.swift +++ b/Sources/Models/ContactPoint.swift @@ -2,7 +2,7 @@ // ContactPoint.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ContactPoint) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ContactPoint) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Details of a Technology mediated contact point (phone, fax, email, etc.). - * - * Details for all kinds of technology mediated contact points for a person or organization, including telephone, - * email, etc. - */ +Details of a Technology mediated contact point (phone, fax, email, etc.). + +Details for all kinds of technology mediated contact points for a person or organization, including telephone, email, +etc. +*/ open class ContactPoint: Element { override open class var resourceType: String { get { return "ContactPoint" } @@ -26,11 +26,11 @@ open class ContactPoint: Element { /// Specify preferred order of use (1 = highest). public var rank: UInt? - /// phone | fax | email | pager | other. - public var system: String? + /// Telecommunications form for contact point - what communications system is required to make use of the contact. + public var system: ContactPointSystem? - /// home | work | temp | old | mobile - purpose of this contact point. - public var use: String? + /// Identifies the purpose for the contact point. + public var use: ContactPointUse? /// The actual contact point details. public var value: String? @@ -64,7 +64,12 @@ open class ContactPoint: Element { if let exist = json["system"] { presentKeys.insert("system") if let val = exist as? String { - self.system = val + if let enumval = ContactPointSystem(rawValue: val) { + self.system = enumval + } + else { + errors.append(FHIRValidationError(key: "system", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "system", wants: String.self, has: type(of: exist))) @@ -73,7 +78,12 @@ open class ContactPoint: Element { if let exist = json["use"] { presentKeys.insert("use") if let val = exist as? String { - self.use = val + if let enumval = ContactPointUse(rawValue: val) { + self.use = enumval + } + else { + errors.append(FHIRValidationError(key: "use", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "use", wants: String.self, has: type(of: exist))) @@ -101,10 +111,10 @@ open class ContactPoint: Element { json["rank"] = rank.asJSON() } if let system = self.system { - json["system"] = system.asJSON() + json["system"] = system.rawValue } if let use = self.use { - json["use"] = use.asJSON() + json["use"] = use.rawValue } if let value = self.value { json["value"] = value.asJSON() diff --git a/Sources/Models/Contract.swift b/Sources/Models/Contract.swift index bc937ddf..9390cac3 100644 --- a/Sources/Models/Contract.swift +++ b/Sources/Models/Contract.swift @@ -2,7 +2,7 @@ // Contract.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Contract) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Contract) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Contract. - * - * A formal agreement between parties regarding the conduct of business, exchange of information or other matters. - */ +Contract. + +A formal agreement between parties regarding the conduct of business, exchange of information or other matters. +*/ open class Contract: DomainResource { override open class var resourceType: String { get { return "Contract" } @@ -430,11 +430,11 @@ open class Contract: DomainResource { /** - * Contract Agent. - * - * An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity - * taking place. - */ +Contract Agent. + +An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking +place. +*/ open class ContractAgent: BackboneElement { override open class var resourceType: String { get { return "ContractAgent" } @@ -506,13 +506,13 @@ open class ContractAgent: BackboneElement { /** - * Contract Friendly Language. - * - * The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the - * representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by - * a layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing - * the Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement. - */ +Contract Friendly Language. + +The "patient friendly language" versionof the Contract in whole or in parts. "Patient friendly language" means the +representation of the Contract and Contract Provisions in a manner that is readily accessible and understandable by a +layperson in accordance with best practices for communication styles that ensure that those agreeing to or signing the +Contract understand the roles, actions, obligations, responsibilities, and implication of the agreement. +*/ open class ContractFriendly: BackboneElement { override open class var resourceType: String { get { return "ContractFriendly" } @@ -594,10 +594,10 @@ open class ContractFriendly: BackboneElement { /** - * Contract Legal Language. - * - * List of Legal expressions or representations of this Contract. - */ +Contract Legal Language. + +List of Legal expressions or representations of this Contract. +*/ open class ContractLegal: BackboneElement { override open class var resourceType: String { get { return "ContractLegal" } @@ -679,10 +679,10 @@ open class ContractLegal: BackboneElement { /** - * Computable Contract Language. - * - * List of Computable Policy Rule Language Representations of this Contract. - */ +Computable Contract Language. + +List of Computable Policy Rule Language Representations of this Contract. +*/ open class ContractRule: BackboneElement { override open class var resourceType: String { get { return "ContractRule" } @@ -764,12 +764,12 @@ open class ContractRule: BackboneElement { /** - * Contract Signer. - * - * Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which - * are any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of - * the contract such as a notary or witness. - */ +Contract Signer. + +Parties with legal standing in the Contract, including the principal parties, the grantor(s) and grantee(s), which are +any person or organization bound by the contract, and any ancillary parties, which facilitate the execution of the +contract such as a notary or witness. +*/ open class ContractSigner: BackboneElement { override open class var resourceType: String { get { return "ContractSigner" } @@ -869,10 +869,10 @@ open class ContractSigner: BackboneElement { /** - * Contract Term List. - * - * One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups. - */ +Contract Term List. + +One or more Contract Provisions, which may be related and conveyed as a group, and may contain nested groups. +*/ open class ContractTerm: BackboneElement { override open class var resourceType: String { get { return "ContractTerm" } @@ -1124,11 +1124,11 @@ open class ContractTerm: BackboneElement { /** - * Contract Term Agent List. - * - * An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity - * taking place. - */ +Contract Term Agent List. + +An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity taking +place. +*/ open class ContractTermAgent: BackboneElement { override open class var resourceType: String { get { return "ContractTermAgent" } @@ -1200,10 +1200,10 @@ open class ContractTermAgent: BackboneElement { /** - * Contract Term Valued Item. - * - * Contract Provision Valued Item List. - */ +Contract Term Valued Item. + +Contract Provision Valued Item List. +*/ open class ContractTermValuedItem: BackboneElement { override open class var resourceType: String { get { return "ContractTermValuedItem" } @@ -1390,10 +1390,10 @@ open class ContractTermValuedItem: BackboneElement { /** - * Contract Valued Item. - * - * Contract Valued Item List. - */ +Contract Valued Item. + +Contract Valued Item List. +*/ open class ContractValuedItem: BackboneElement { override open class var resourceType: String { get { return "ContractValuedItem" } diff --git a/Sources/Models/Contributor.swift b/Sources/Models/Contributor.swift index 06e4cdd3..c96a069b 100644 --- a/Sources/Models/Contributor.swift +++ b/Sources/Models/Contributor.swift @@ -2,7 +2,7 @@ // Contributor.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Contributor) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Contributor) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Contributor information. - * - * A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers. - */ +Contributor information. + +A contributor to the content of a knowledge asset, including authors, editors, reviewers, and endorsers. +*/ open class Contributor: Element { override open class var resourceType: String { get { return "Contributor" } @@ -25,12 +25,12 @@ open class Contributor: Element { /// Name of the contributor. public var name: String? - /// author | editor | reviewer | endorser. - public var type: String? + /// The type of contributor. + public var type: ContributorType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(name: String, type: String) { + public convenience init(name: String, type: ContributorType) { self.init() self.name = name self.type = type @@ -68,7 +68,12 @@ open class Contributor: Element { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = ContributorType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -90,7 +95,7 @@ open class Contributor: Element { json["name"] = name.asJSON() } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json diff --git a/Sources/Models/Count.swift b/Sources/Models/Count.swift index b995c1d5..627fed30 100644 --- a/Sources/Models/Count.swift +++ b/Sources/Models/Count.swift @@ -2,7 +2,7 @@ // Count.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Count) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Count) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * A measured or measurable amount. - * - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that - * are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ +A measured or measurable amount. + +A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are +not precisely quantified, including amounts involving arbitrary units and floating currencies. +*/ open class Count: Quantity { override open class var resourceType: String { get { return "Count" } diff --git a/Sources/Models/Coverage.swift b/Sources/Models/Coverage.swift index 63e3e6d0..80f1a96c 100644 --- a/Sources/Models/Coverage.swift +++ b/Sources/Models/Coverage.swift @@ -2,7 +2,7 @@ // Coverage.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Coverage) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Coverage) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Insurance or medical plan or a payment agreement. - * - * Financial instrument which may be used to pay for or reimburse health care products and services. - */ +Insurance or medical plan or a payment agreement. + +Financial instrument which may be used to pay for or reimburse health care products and services. +*/ open class Coverage: DomainResource { override open class var resourceType: String { get { return "Coverage" } @@ -55,15 +55,15 @@ open class Coverage: DomainResource { /// The plan instance or sequence counter. public var sequence: UInt? - /// active | cancelled | draft | entered-in-error. - public var status: String? + /// The status of the resource instance. + public var status: CoverageStatus? /// Type of coverage. public var type: Coding? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(beneficiary: Reference, issuer: Reference, planholder: Reference, relationship: Coding, status: String) { + public convenience init(beneficiary: Reference, issuer: Reference, planholder: Reference, relationship: Coding, status: CoverageStatus) { self.init() self.beneficiary = beneficiary self.issuer = issuer @@ -238,7 +238,12 @@ open class Coverage: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = CoverageStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -304,7 +309,7 @@ open class Coverage: DomainResource { json["sequence"] = sequence.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let type = self.type { json["type"] = type.asJSON(errors: &errors) diff --git a/Sources/Models/DataElement.swift b/Sources/Models/DataElement.swift index a68f617f..3d781019 100644 --- a/Sources/Models/DataElement.swift +++ b/Sources/Models/DataElement.swift @@ -2,7 +2,7 @@ // DataElement.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/DataElement) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/DataElement) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Resource data element. - * - * The formal description of a single piece of information that can be gathered and reported. - */ +Resource data element. + +The formal description of a single piece of information that can be gathered and reported. +*/ open class DataElement: DomainResource { override open class var resourceType: String { get { return "DataElement" } @@ -49,11 +49,11 @@ open class DataElement: DomainResource { /// Name of the publisher (Organization or individual). public var publisher: String? - /// draft | active | retired. - public var status: String? + /// The status of this data element. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? - /// comparable | fully-specified | equivalent | convertable | scaleable | flexible. - public var stringency: String? + /// Identifies how precise the data element is in its definition. + public var stringency: DataElementStringency? /// Name for this data element (Human friendly). public var title: String? @@ -69,7 +69,7 @@ open class DataElement: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(element: [ElementDefinition], status: String) { + public convenience init(element: [ElementDefinition], status: PublicationStatus) { self.init() self.element = element self.status = status @@ -199,7 +199,12 @@ open class DataElement: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -211,7 +216,12 @@ open class DataElement: DomainResource { if let exist = json["stringency"] { presentKeys.insert("stringency") if let val = exist as? String { - self.stringency = val + if let enumval = DataElementStringency(rawValue: val) { + self.stringency = enumval + } + else { + errors.append(FHIRValidationError(key: "stringency", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "stringency", wants: String.self, has: type(of: exist))) @@ -295,10 +305,10 @@ open class DataElement: DomainResource { json["publisher"] = publisher.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let stringency = self.stringency { - json["stringency"] = stringency.asJSON() + json["stringency"] = stringency.rawValue } if let title = self.title { json["title"] = title.asJSON() @@ -319,11 +329,11 @@ open class DataElement: DomainResource { /** - * External specification mapped to. - * - * Identifies a specification (other than a terminology) that the elements which make up the DataElement have some - * correspondence with. - */ +External specification mapped to. + +Identifies a specification (other than a terminology) that the elements which make up the DataElement have some +correspondence with. +*/ open class DataElementMapping: BackboneElement { override open class var resourceType: String { get { return "DataElementMapping" } diff --git a/Sources/Models/DataRequirement.swift b/Sources/Models/DataRequirement.swift index 8d97df69..04c715ba 100644 --- a/Sources/Models/DataRequirement.swift +++ b/Sources/Models/DataRequirement.swift @@ -2,7 +2,7 @@ // DataRequirement.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/DataRequirement) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/DataRequirement) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Describes a required data item. - * - * Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters - * of the data. - */ +Describes a required data item. + +Describes a required data item for evaluation in terms of the type of data, and optional code- or date-based filters of +the data. +*/ open class DataRequirement: Element { override open class var resourceType: String { get { return "DataRequirement" } @@ -121,11 +121,7 @@ open class DataRequirement: Element { json["dateFilter"] = dateFilter.map() { $0.asJSON(errors: &errors) } } if let mustSupport = self.mustSupport { - var arr = [Any]() - for val in mustSupport { - arr.append(val.asJSON()) - } - json["mustSupport"] = arr + json["mustSupport"] = mustSupport.map() { $0.asJSON() } } if let profile = self.profile { json["profile"] = profile.map() { $0.asJSON(errors: &errors) } @@ -140,11 +136,11 @@ open class DataRequirement: Element { /** - * Code filters for the data. - * - * Code filters specify additional constraints on the data, specifying the value set of interest for a particular - * element of the data. - */ +Code filters for the data. + +Code filters specify additional constraints on the data, specifying the value set of interest for a particular element +of the data. +*/ open class DataRequirementCodeFilter: Element { override open class var resourceType: String { get { return "DataRequirementCodeFilter" } @@ -260,11 +256,7 @@ open class DataRequirementCodeFilter: Element { json["path"] = path.asJSON() } if let valueCode = self.valueCode { - var arr = [Any]() - for val in valueCode { - arr.append(val.asJSON()) - } - json["valueCode"] = arr + json["valueCode"] = valueCode.map() { $0.asJSON() } } if let valueCodeableConcept = self.valueCodeableConcept { json["valueCodeableConcept"] = valueCodeableConcept.map() { $0.asJSON(errors: &errors) } @@ -285,10 +277,10 @@ open class DataRequirementCodeFilter: Element { /** - * Date filters for the data. - * - * Date filters specify additional constraints on the data in terms of the applicable date range for specific elements. - */ +Date filters for the data. + +Date filters specify additional constraints on the data in terms of the applicable date range for specific elements. +*/ open class DataRequirementDateFilter: Element { override open class var resourceType: String { get { return "DataRequirementDateFilter" } diff --git a/Sources/Models/DetectedIssue.swift b/Sources/Models/DetectedIssue.swift index a0307793..f484473d 100644 --- a/Sources/Models/DetectedIssue.swift +++ b/Sources/Models/DetectedIssue.swift @@ -2,7 +2,7 @@ // DetectedIssue.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/DetectedIssue) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/DetectedIssue) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Clinical issue with action. - * - * Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for - * a patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. - */ +Clinical issue with action. + +Indicates an actual or potential clinical issue with or between one or more active or proposed clinical actions for a +patient; e.g. Drug-drug interaction, Ineffective treatment frequency, Procedure-condition conflict, etc. +*/ open class DetectedIssue: DomainResource { override open class var resourceType: String { get { return "DetectedIssue" } @@ -47,8 +47,9 @@ open class DetectedIssue: DomainResource { /// Authority for issue. public var reference: URL? - /// high | moderate | low. - public var severity: String? + /// Indicates the degree of importance associated with the identified issue based on the potential impact on the + /// patient. + public var severity: DetectedIssueSeverity? override open func populate(from json: FHIRJSON, presentKeys: inout Set) throws -> [FHIRValidationError]? { @@ -167,7 +168,12 @@ open class DetectedIssue: DomainResource { if let exist = json["severity"] { presentKeys.insert("severity") if let val = exist as? String { - self.severity = val + if let enumval = DetectedIssueSeverity(rawValue: val) { + self.severity = enumval + } + else { + errors.append(FHIRValidationError(key: "severity", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "severity", wants: String.self, has: type(of: exist))) @@ -207,7 +213,7 @@ open class DetectedIssue: DomainResource { json["reference"] = reference.asJSON() } if let severity = self.severity { - json["severity"] = severity.asJSON() + json["severity"] = severity.rawValue } return json @@ -216,12 +222,12 @@ open class DetectedIssue: DomainResource { /** - * Step taken to address. - * - * Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk - * identified by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that - * may reduce/eliminate the need for any action. - */ +Step taken to address. + +Indicates an action that has been taken or is committed to to reduce or eliminate the likelihood of the risk identified +by the detected issue from manifesting. Can also reflect an observation of known mitigating factors that may +reduce/eliminate the need for any action. +*/ open class DetectedIssueMitigation: BackboneElement { override open class var resourceType: String { get { return "DetectedIssueMitigation" } diff --git a/Sources/Models/Device.swift b/Sources/Models/Device.swift index bad87e76..4deea4e1 100644 --- a/Sources/Models/Device.swift +++ b/Sources/Models/Device.swift @@ -2,7 +2,7 @@ // Device.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Device) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Device) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,14 +10,14 @@ import Foundation /** - * Item used in healthcare. - * - * This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare - * without being substantially changed through that activity. The device may be a medical or non-medical device. - * Medical devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment - * used for diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include - * items such as a machine, cellphone, computer, application, etc. - */ +Item used in healthcare. + +This resource identifies an instance or a type of a manufactured item that is used in the provision of healthcare +without being substantially changed through that activity. The device may be a medical or non-medical device. Medical +devices includes durable (reusable) medical equipment, implantable devices, as well as disposable equipment used for +diagnostic, treatment, and research for healthcare and public health. Non-medical devices may include items such as a +machine, cellphone, computer, application, etc. +*/ open class Device: DomainResource { override open class var resourceType: String { get { return "Device" } @@ -56,8 +56,8 @@ open class Device: DomainResource { /// Patient to whom Device is affixed. public var patient: Reference? - /// available | not-available | entered-in-error. - public var status: String? + /// Status of the Device availability. + public var status: DeviceStatus? /// What kind of device this is. public var type: CodeableConcept? @@ -213,7 +213,12 @@ open class Device: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = DeviceStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -308,7 +313,7 @@ open class Device: DomainResource { json["patient"] = patient.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let type = self.type { json["type"] = type.asJSON(errors: &errors) diff --git a/Sources/Models/DeviceComponent.swift b/Sources/Models/DeviceComponent.swift index b3b6fcbe..36729bbe 100644 --- a/Sources/Models/DeviceComponent.swift +++ b/Sources/Models/DeviceComponent.swift @@ -2,7 +2,7 @@ // DeviceComponent.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/DeviceComponent) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/DeviceComponent) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,10 @@ import Foundation /** - * An instance of a medical-related component of a medical device. - * - * Describes the characteristics, operational status and capabilities of a medical-related component of a medical - * device. - */ +An instance of a medical-related component of a medical device. + +Describes the characteristics, operational status and capabilities of a medical-related component of a medical device. +*/ open class DeviceComponent: DomainResource { override open class var resourceType: String { get { return "DeviceComponent" } @@ -29,8 +28,8 @@ open class DeviceComponent: DomainResource { /// Recent system change timestamp. public var lastSystemChange: Instant? - /// other | chemical | electrical | impedance | nuclear | optical | thermal | biological | mechanical | acoustical | manual+. - public var measurementPrinciple: String? + /// Describes the physical principle of the measurement. For example: thermal, chemical, acoustical, etc. + public var measurementPrinciple: MeasmntPrinciple? /// Component operational status. public var operationalStatus: [CodeableConcept]? @@ -108,7 +107,12 @@ open class DeviceComponent: DomainResource { if let exist = json["measurementPrinciple"] { presentKeys.insert("measurementPrinciple") if let val = exist as? String { - self.measurementPrinciple = val + if let enumval = MeasmntPrinciple(rawValue: val) { + self.measurementPrinciple = enumval + } + else { + errors.append(FHIRValidationError(key: "measurementPrinciple", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "measurementPrinciple", wants: String.self, has: type(of: exist))) @@ -217,7 +221,7 @@ open class DeviceComponent: DomainResource { json["lastSystemChange"] = lastSystemChange.asJSON() } if let measurementPrinciple = self.measurementPrinciple { - json["measurementPrinciple"] = measurementPrinciple.asJSON() + json["measurementPrinciple"] = measurementPrinciple.rawValue } if let operationalStatus = self.operationalStatus { json["operationalStatus"] = operationalStatus.map() { $0.asJSON(errors: &errors) } @@ -244,10 +248,10 @@ open class DeviceComponent: DomainResource { /** - * Production specification of the component. - * - * Describes the production specification such as component revision, serial number, etc. - */ +Production specification of the component. + +Describes the production specification such as component revision, serial number, etc. +*/ open class DeviceComponentProductionSpecification: BackboneElement { override open class var resourceType: String { get { return "DeviceComponentProductionSpecification" } diff --git a/Sources/Models/DeviceMetric.swift b/Sources/Models/DeviceMetric.swift index 4856cda4..96107bc5 100644 --- a/Sources/Models/DeviceMetric.swift +++ b/Sources/Models/DeviceMetric.swift @@ -2,7 +2,7 @@ // DeviceMetric.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/DeviceMetric) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/DeviceMetric) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Measurement, calculation or setting capability of a medical device. - * - * Describes a measurement, calculation or setting capability of a medical device. - */ +Measurement, calculation or setting capability of a medical device. + +Describes a measurement, calculation or setting capability of a medical device. +*/ open class DeviceMetric: DomainResource { override open class var resourceType: String { get { return "DeviceMetric" } @@ -22,11 +22,15 @@ open class DeviceMetric: DomainResource { /// Describes the calibrations that have been performed or that are required to be performed. public var calibration: [DeviceMetricCalibration]? - /// measurement | setting | calculation | unspecified. - public var category: String? + /// Indicates the category of the observation generation process. A DeviceMetric can be for example a setting, + /// measurement, or calculation. + public var category: DeviceMetricCategory? - /// black | red | green | yellow | blue | magenta | cyan | white. - public var color: String? + /// Describes the color representation for the metric. This is often used to aid clinicians to track and identify + /// parameter types by color. In practice, consider a Patient Monitor that has ECG/HR and Pleth for example; the + /// parameters are displayed in different characteristic colors, such as HR-blue, BP-green, and PR and SpO2- + /// magenta. + public var color: DeviceMetricColor? /// Unique identifier of this DeviceMetric. public var identifier: Identifier? @@ -34,8 +38,8 @@ open class DeviceMetric: DomainResource { /// Describes the measurement repetition time. public var measurementPeriod: Timing? - /// on | off | standby. - public var operationalStatus: String? + /// Indicates current operational state of the device. For example: On, Off, Standby, etc. + public var operationalStatus: DeviceMetricOperationalStatus? /// Describes the link to the parent DeviceComponent. public var parent: Reference? @@ -51,7 +55,7 @@ open class DeviceMetric: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(category: String, identifier: Identifier, type: CodeableConcept) { + public convenience init(category: DeviceMetricCategory, identifier: Identifier, type: CodeableConcept) { self.init() self.category = category self.identifier = identifier @@ -78,7 +82,12 @@ open class DeviceMetric: DomainResource { if let exist = json["category"] { presentKeys.insert("category") if let val = exist as? String { - self.category = val + if let enumval = DeviceMetricCategory(rawValue: val) { + self.category = enumval + } + else { + errors.append(FHIRValidationError(key: "category", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "category", wants: String.self, has: type(of: exist))) @@ -90,7 +99,12 @@ open class DeviceMetric: DomainResource { if let exist = json["color"] { presentKeys.insert("color") if let val = exist as? String { - self.color = val + if let enumval = DeviceMetricColor(rawValue: val) { + self.color = enumval + } + else { + errors.append(FHIRValidationError(key: "color", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "color", wants: String.self, has: type(of: exist))) @@ -130,7 +144,12 @@ open class DeviceMetric: DomainResource { if let exist = json["operationalStatus"] { presentKeys.insert("operationalStatus") if let val = exist as? String { - self.operationalStatus = val + if let enumval = DeviceMetricOperationalStatus(rawValue: val) { + self.operationalStatus = enumval + } + else { + errors.append(FHIRValidationError(key: "operationalStatus", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "operationalStatus", wants: String.self, has: type(of: exist))) @@ -205,10 +224,10 @@ open class DeviceMetric: DomainResource { json["calibration"] = calibration.map() { $0.asJSON(errors: &errors) } } if let category = self.category { - json["category"] = category.asJSON() + json["category"] = category.rawValue } if let color = self.color { - json["color"] = color.asJSON() + json["color"] = color.rawValue } if let identifier = self.identifier { json["identifier"] = identifier.asJSON(errors: &errors) @@ -217,7 +236,7 @@ open class DeviceMetric: DomainResource { json["measurementPeriod"] = measurementPeriod.asJSON(errors: &errors) } if let operationalStatus = self.operationalStatus { - json["operationalStatus"] = operationalStatus.asJSON() + json["operationalStatus"] = operationalStatus.rawValue } if let parent = self.parent { json["parent"] = parent.asJSON(errors: &errors) @@ -238,21 +257,21 @@ open class DeviceMetric: DomainResource { /** - * Describes the calibrations that have been performed or that are required to be performed. - */ +Describes the calibrations that have been performed or that are required to be performed. +*/ open class DeviceMetricCalibration: BackboneElement { override open class var resourceType: String { get { return "DeviceMetricCalibration" } } - /// not-calibrated | calibration-required | calibrated | unspecified. - public var state: String? + /// Describes the state of the calibration. + public var state: DeviceMetricCalibrationState? /// Describes the time last calibration has been performed. public var time: Instant? - /// unspecified | offset | gain | two-point. - public var type: String? + /// Describes the type of the calibration method. + public var type: DeviceMetricCalibrationType? override open func populate(from json: FHIRJSON, presentKeys: inout Set) throws -> [FHIRValidationError]? { @@ -260,7 +279,12 @@ open class DeviceMetricCalibration: BackboneElement { if let exist = json["state"] { presentKeys.insert("state") if let val = exist as? String { - self.state = val + if let enumval = DeviceMetricCalibrationState(rawValue: val) { + self.state = enumval + } + else { + errors.append(FHIRValidationError(key: "state", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "state", wants: String.self, has: type(of: exist))) @@ -278,7 +302,12 @@ open class DeviceMetricCalibration: BackboneElement { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = DeviceMetricCalibrationType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -291,13 +320,13 @@ open class DeviceMetricCalibration: BackboneElement { var json = super.asJSON(errors: &errors) if let state = self.state { - json["state"] = state.asJSON() + json["state"] = state.rawValue } if let time = self.time { json["time"] = time.asJSON() } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json diff --git a/Sources/Models/DeviceUseRequest.swift b/Sources/Models/DeviceUseRequest.swift index 996072a5..1165c975 100644 --- a/Sources/Models/DeviceUseRequest.swift +++ b/Sources/Models/DeviceUseRequest.swift @@ -2,7 +2,7 @@ // DeviceUseRequest.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/DeviceUseRequest) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/DeviceUseRequest) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Medical device request. - * - * Represents a request for a patient to employ a medical device. The device may be an implantable device, or an - * external assistive device, such as a walker. - */ +Medical device request. + +Represents a request for a patient to employ a medical device. The device may be an implantable device, or an external +assistive device, such as a walker. +*/ open class DeviceUseRequest: DomainResource { override open class var resourceType: String { get { return "DeviceUseRequest" } diff --git a/Sources/Models/DeviceUseStatement.swift b/Sources/Models/DeviceUseStatement.swift index 44df8505..e25d18df 100644 --- a/Sources/Models/DeviceUseStatement.swift +++ b/Sources/Models/DeviceUseStatement.swift @@ -2,7 +2,7 @@ // DeviceUseStatement.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/DeviceUseStatement) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/DeviceUseStatement) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Record of use of a device. - * - * A record of a device being used by a patient where the record is the result of a report from the patient or another - * clinician. - */ +Record of use of a device. + +A record of a device being used by a patient where the record is the result of a report from the patient or another +clinician. +*/ open class DeviceUseStatement: DomainResource { override open class var resourceType: String { get { return "DeviceUseStatement" } @@ -248,11 +248,7 @@ open class DeviceUseStatement: DomainResource { json["indication"] = indication.map() { $0.asJSON(errors: &errors) } } if let notes = self.notes { - var arr = [Any]() - for val in notes { - arr.append(val.asJSON()) - } - json["notes"] = arr + json["notes"] = notes.map() { $0.asJSON() } } if let recordedOn = self.recordedOn { json["recordedOn"] = recordedOn.asJSON() diff --git a/Sources/Models/DiagnosticReport.swift b/Sources/Models/DiagnosticReport.swift index 5fd5fef0..d33d12b4 100644 --- a/Sources/Models/DiagnosticReport.swift +++ b/Sources/Models/DiagnosticReport.swift @@ -2,7 +2,7 @@ // DiagnosticReport.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/DiagnosticReport) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/DiagnosticReport) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,14 +10,14 @@ import Foundation /** - * A Diagnostic report - a combination of request information, atomic results, images, interpretation, as well as - * formatted reports. - * - * The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and - * locations, and/or specimens derived from these. The report includes clinical context such as requesting and provider - * information, and some mix of atomic results, images, textual and coded interpretations, and formatted representation - * of diagnostic reports. - */ +A Diagnostic report - a combination of request information, atomic results, images, interpretation, as well as formatted +reports. + +The findings and interpretation of diagnostic tests performed on patients, groups of patients, devices, and locations, +and/or specimens derived from these. The report includes clinical context such as requesting and provider information, +and some mix of atomic results, images, textual and coded interpretations, and formatted representation of diagnostic +reports. +*/ open class DiagnosticReport: DomainResource { override open class var resourceType: String { get { return "DiagnosticReport" } @@ -71,15 +71,15 @@ open class DiagnosticReport: DomainResource { /// Specimens this report is based on. public var specimen: [Reference]? - /// registered | partial | final | corrected | appended | cancelled | entered-in-error. - public var status: String? + /// The status of the diagnostic report as a whole. + public var status: DiagnosticReportStatus? /// The subject of the report, usually, but not always, the patient. public var subject: Reference? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(code: CodeableConcept, effective: Any, issued: Instant, performer: [Reference], status: String, subject: Reference) { + public convenience init(code: CodeableConcept, effective: Any, issued: Instant, performer: [Reference], status: DiagnosticReportStatus, subject: Reference) { self.init() self.code = code if let value = effective as? DateTime { @@ -321,7 +321,12 @@ open class DiagnosticReport: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = DiagnosticReportStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -407,7 +412,7 @@ open class DiagnosticReport: DomainResource { json["specimen"] = specimen.map() { $0.asJSON(errors: &errors) } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) @@ -419,11 +424,11 @@ open class DiagnosticReport: DomainResource { /** - * Key images associated with this report. - * - * A list of key images associated with this report. The images are generally created during the diagnostic process, - * and may be directly of the patient, or of treated specimens (i.e. slides of interest). - */ +Key images associated with this report. + +A list of key images associated with this report. The images are generally created during the diagnostic process, and +may be directly of the patient, or of treated specimens (i.e. slides of interest). +*/ open class DiagnosticReportImage: BackboneElement { override open class var resourceType: String { get { return "DiagnosticReportImage" } diff --git a/Sources/Models/DiagnosticRequest.swift b/Sources/Models/DiagnosticRequest.swift index 13b1e728..1d19824b 100644 --- a/Sources/Models/DiagnosticRequest.swift +++ b/Sources/Models/DiagnosticRequest.swift @@ -2,7 +2,7 @@ // DiagnosticRequest.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/DiagnosticRequest) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/DiagnosticRequest) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * A request for a diagnostic service. - * - * A record of a request for a diagnostic investigation service to be performed. - */ +A request for a diagnostic service. + +A record of a request for a diagnostic investigation service to be performed. +*/ open class DiagnosticRequest: DomainResource { override open class var resourceType: String { get { return "DiagnosticRequest" } diff --git a/Sources/Models/Distance.swift b/Sources/Models/Distance.swift index 8015edf7..7a43ebb4 100644 --- a/Sources/Models/Distance.swift +++ b/Sources/Models/Distance.swift @@ -2,7 +2,7 @@ // Distance.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Distance) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Distance) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,8 +10,8 @@ import Foundation /** - * A length - a value with a unit that is a physical distance. - */ +A length - a value with a unit that is a physical distance. +*/ open class Distance: Quantity { override open class var resourceType: String { get { return "Distance" } diff --git a/Sources/Models/DocumentManifest.swift b/Sources/Models/DocumentManifest.swift index bf07506c..6d314c31 100644 --- a/Sources/Models/DocumentManifest.swift +++ b/Sources/Models/DocumentManifest.swift @@ -2,7 +2,7 @@ // DocumentManifest.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/DocumentManifest) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/DocumentManifest) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,8 +10,8 @@ import Foundation /** - * A manifest that defines a set of documents. - */ +A manifest that defines a set of documents. +*/ open class DocumentManifest: DomainResource { override open class var resourceType: String { get { return "DocumentManifest" } @@ -44,8 +44,8 @@ open class DocumentManifest: DomainResource { /// The source system/application/software. public var source: URL? - /// current | superseded | entered-in-error. - public var status: String? + /// The status of this document manifest. + public var status: DocumentReferenceStatus? /// The subject of the set of documents. public var subject: Reference? @@ -55,7 +55,7 @@ open class DocumentManifest: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(content: [DocumentManifestContent], status: String) { + public convenience init(content: [DocumentManifestContent], status: DocumentReferenceStatus) { self.init() self.content = content self.status = status @@ -181,7 +181,12 @@ open class DocumentManifest: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = DocumentReferenceStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -252,7 +257,7 @@ open class DocumentManifest: DomainResource { json["source"] = source.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) @@ -267,10 +272,10 @@ open class DocumentManifest: DomainResource { /** - * The items included. - * - * The list of Documents included in the manifest. - */ +The items included. + +The list of Documents included in the manifest. +*/ open class DocumentManifestContent: BackboneElement { override open class var resourceType: String { get { return "DocumentManifestContent" } @@ -352,10 +357,10 @@ open class DocumentManifestContent: BackboneElement { /** - * Related things. - * - * Related identifiers or resources associated with the DocumentManifest. - */ +Related things. + +Related identifiers or resources associated with the DocumentManifest. +*/ open class DocumentManifestRelated: BackboneElement { override open class var resourceType: String { get { return "DocumentManifestRelated" } diff --git a/Sources/Models/DocumentReference.swift b/Sources/Models/DocumentReference.swift index cae0f115..325b64b4 100644 --- a/Sources/Models/DocumentReference.swift +++ b/Sources/Models/DocumentReference.swift @@ -2,7 +2,7 @@ // DocumentReference.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/DocumentReference) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/DocumentReference) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,24 +10,24 @@ import Foundation /** - * A reference to a document. - * - * A reference to a document . - */ +A reference to a document. + +A reference to a document . +*/ open class DocumentReference: DomainResource { override open class var resourceType: String { get { return "DocumentReference" } } + /// Categorization of document. + public var `class`: CodeableConcept? + /// Who/what authenticated the document. public var authenticator: Reference? /// Who and/or what authored the document. public var author: [Reference]? - /// Categorization of document. - public var class_fhir: CodeableConcept? - /// Document referenced. public var content: [DocumentReferenceContent]? @@ -61,8 +61,8 @@ open class DocumentReference: DomainResource { /// Document security-tags. public var securityLabel: [CodeableConcept]? - /// current | superseded | entered-in-error. - public var status: String? + /// The status of this document reference. + public var status: DocumentReferenceStatus? /// Who/what is the subject of the document. public var subject: Reference? @@ -72,7 +72,7 @@ open class DocumentReference: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(content: [DocumentReferenceContent], indexed: Instant, status: String, type: CodeableConcept) { + public convenience init(content: [DocumentReferenceContent], indexed: Instant, status: DocumentReferenceStatus, type: CodeableConcept) { self.init() self.content = content self.indexed = indexed @@ -83,6 +83,20 @@ open class DocumentReference: DomainResource { override open func populate(from json: FHIRJSON, presentKeys: inout Set) throws -> [FHIRValidationError]? { var errors = try super.populate(from: json, presentKeys: &presentKeys) ?? [FHIRValidationError]() + if let exist = json["class"] { + presentKeys.insert("class") + if let val = exist as? FHIRJSON { + do { + self.`class` = try CodeableConcept(json: val, owner: self) + } + catch let error as FHIRValidationError { + errors.append(error.prefixed(with: "class")) + } + } + else { + errors.append(FHIRValidationError(key: "class", wants: FHIRJSON.self, has: type(of: exist))) + } + } if let exist = json["authenticator"] { presentKeys.insert("authenticator") if let val = exist as? FHIRJSON { @@ -111,20 +125,6 @@ open class DocumentReference: DomainResource { errors.append(FHIRValidationError(key: "author", wants: Array.self, has: type(of: exist))) } } - if let exist = json["class"] { - presentKeys.insert("class") - if let val = exist as? FHIRJSON { - do { - self.class_fhir = try CodeableConcept(json: val, owner: self) - } - catch let error as FHIRValidationError { - errors.append(error.prefixed(with: "class")) - } - } - else { - errors.append(FHIRValidationError(key: "class", wants: FHIRJSON.self, has: type(of: exist))) - } - } if let exist = json["content"] { presentKeys.insert("content") if let val = exist as? [FHIRJSON] { @@ -273,7 +273,12 @@ open class DocumentReference: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = DocumentReferenceStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -319,15 +324,15 @@ open class DocumentReference: DomainResource { override open func asJSON(errors: inout [FHIRValidationError]) -> FHIRJSON { var json = super.asJSON(errors: &errors) + if let `class` = self.`class` { + json["class"] = `class`.asJSON(errors: &errors) + } if let authenticator = self.authenticator { json["authenticator"] = authenticator.asJSON(errors: &errors) } if let author = self.author { json["author"] = author.map() { $0.asJSON(errors: &errors) } } - if let class_fhir = self.class_fhir { - json["class"] = class_fhir.asJSON(errors: &errors) - } if let content = self.content { json["content"] = content.map() { $0.asJSON(errors: &errors) } } @@ -362,7 +367,7 @@ open class DocumentReference: DomainResource { json["securityLabel"] = securityLabel.map() { $0.asJSON(errors: &errors) } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) @@ -377,10 +382,10 @@ open class DocumentReference: DomainResource { /** - * Document referenced. - * - * The document and format referenced. There may be multiple content element repetitions, each with a different format. - */ +Document referenced. + +The document and format referenced. There may be multiple content element repetitions, each with a different format. +*/ open class DocumentReferenceContent: BackboneElement { override open class var resourceType: String { get { return "DocumentReferenceContent" } @@ -452,10 +457,10 @@ open class DocumentReferenceContent: BackboneElement { /** - * Clinical context of document. - * - * The clinical context in which the document was prepared. - */ +Clinical context of document. + +The clinical context in which the document was prepared. +*/ open class DocumentReferenceContext: BackboneElement { override open class var resourceType: String { get { return "DocumentReferenceContext" } @@ -617,10 +622,10 @@ open class DocumentReferenceContext: BackboneElement { /** - * Related identifiers or resources. - * - * Related identifiers or resources associated with the DocumentReference. - */ +Related identifiers or resources. + +Related identifiers or resources associated with the DocumentReference. +*/ open class DocumentReferenceContextRelated: BackboneElement { override open class var resourceType: String { get { return "DocumentReferenceContextRelated" } @@ -682,24 +687,24 @@ open class DocumentReferenceContextRelated: BackboneElement { /** - * Relationships to other documents. - * - * Relationships that this document has with other document references that already exist. - */ +Relationships to other documents. + +Relationships that this document has with other document references that already exist. +*/ open class DocumentReferenceRelatesTo: BackboneElement { override open class var resourceType: String { get { return "DocumentReferenceRelatesTo" } } - /// replaces | transforms | signs | appends. - public var code: String? + /// The type of relationship that this document has with anther document. + public var code: DocumentRelationshipType? /// Target of the relationship. public var target: Reference? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(code: String, target: Reference) { + public convenience init(code: DocumentRelationshipType, target: Reference) { self.init() self.code = code self.target = target @@ -711,7 +716,12 @@ open class DocumentReferenceRelatesTo: BackboneElement { if let exist = json["code"] { presentKeys.insert("code") if let val = exist as? String { - self.code = val + if let enumval = DocumentRelationshipType(rawValue: val) { + self.code = enumval + } + else { + errors.append(FHIRValidationError(key: "code", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "code", wants: String.self, has: type(of: exist))) @@ -744,7 +754,7 @@ open class DocumentReferenceRelatesTo: BackboneElement { var json = super.asJSON(errors: &errors) if let code = self.code { - json["code"] = code.asJSON() + json["code"] = code.rawValue } if let target = self.target { json["target"] = target.asJSON(errors: &errors) diff --git a/Sources/Models/DomainResource.swift b/Sources/Models/DomainResource.swift index b4f1ebdd..086bbbfd 100644 --- a/Sources/Models/DomainResource.swift +++ b/Sources/Models/DomainResource.swift @@ -2,7 +2,7 @@ // DomainResource.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/DomainResource) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/DomainResource) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * A resource with narrative, extensions, and contained resources. - * - * A resource that includes narrative, extensions, and contained resources. - */ +A resource with narrative, extensions, and contained resources. + +A resource that includes narrative, extensions, and contained resources. +*/ open class DomainResource: Resource { override open class var resourceType: String { get { return "DomainResource" } diff --git a/Sources/Models/DosageInstruction.swift b/Sources/Models/DosageInstruction.swift index 8d1b1427..30b5a810 100644 --- a/Sources/Models/DosageInstruction.swift +++ b/Sources/Models/DosageInstruction.swift @@ -2,7 +2,7 @@ // DosageInstruction.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/DosageInstruction) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/DosageInstruction) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * How medication should be taken. - * - * Indicates how the medication is to be used by the patient. - */ +How medication should be taken. + +Indicates how the medication is to be used by the patient. +*/ open class DosageInstruction: Element { override open class var resourceType: String { get { return "DosageInstruction" } diff --git a/Sources/Models/Duration.swift b/Sources/Models/Duration.swift index e7b9afbf..017c2fd9 100644 --- a/Sources/Models/Duration.swift +++ b/Sources/Models/Duration.swift @@ -2,7 +2,7 @@ // Duration.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Duration) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Duration) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,8 +10,8 @@ import Foundation /** - * A length of time. - */ +A length of time. +*/ open class Duration: Quantity { override open class var resourceType: String { get { return "Duration" } diff --git a/Sources/Models/Element.swift b/Sources/Models/Element.swift index c4b1c20a..610426dc 100644 --- a/Sources/Models/Element.swift +++ b/Sources/Models/Element.swift @@ -2,7 +2,7 @@ // Element.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Element) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Element) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Base for all elements. - * - * Base definition for all elements in a resource. - */ +Base for all elements. + +Base definition for all elements in a resource. +*/ open class Element: FHIRAbstractBase { override open class var resourceType: String { get { return "Element" } diff --git a/Sources/Models/ElementDefinition.swift b/Sources/Models/ElementDefinition.swift index 658573fc..4fdb4cfe 100644 --- a/Sources/Models/ElementDefinition.swift +++ b/Sources/Models/ElementDefinition.swift @@ -2,7 +2,7 @@ // ElementDefinition.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ElementDefinition) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ElementDefinition) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Definition of an element in a resource or extension. - * - * Captures constraints on each element within the resource, profile, or extension. - */ +Definition of an element in a resource or extension. + +Captures constraints on each element within the resource, profile, or extension. +*/ open class ElementDefinition: Element { override open class var resourceType: String { get { return "ElementDefinition" } @@ -586,8 +586,8 @@ open class ElementDefinition: Element { /// Value must have at least these property values. public var patternUri: URL? - /// xmlAttr | xmlText | typeAttr | cdaText | xhtml. - public var representation: [String]? + /// Codes that define how this element is represented in instances, when the deviation varies from the normal case. + public var representation: [PropertyRepresentation]? /// Why this resource has been created. public var requirements: String? @@ -2795,8 +2795,12 @@ open class ElementDefinition: Element { } if let exist = json["representation"] { presentKeys.insert("representation") - if let val = exist as? [String] { - self.representation = val + if let val = exist as? [String] { var i = -1 + self.representation = val.map() { i += 1 + if let enumval = PropertyRepresentation(rawValue: $0) { return enumval } + errors.append(FHIRValidationError(key: "representation.\(i)", problem: "the value “\(val)” is not valid")) + return nil + }.filter() { nil != $0 }.map() { $0! } } else { errors.append(FHIRValidationError(key: "representation", wants: Array.self, has: type(of: exist))) @@ -2864,11 +2868,7 @@ open class ElementDefinition: Element { var json = super.asJSON(errors: &errors) if let alias = self.alias { - var arr = [Any]() - for val in alias { - arr.append(val.asJSON()) - } - json["alias"] = arr + json["alias"] = alias.map() { $0.asJSON() } } if let base = self.base { json["base"] = base.asJSON(errors: &errors) @@ -2883,11 +2883,7 @@ open class ElementDefinition: Element { json["comments"] = comments.asJSON() } if let condition = self.condition { - var arr = [Any]() - for val in condition { - arr.append(val.asJSON()) - } - json["condition"] = arr + json["condition"] = condition.map() { $0.asJSON() } } if let constraint = self.constraint { json["constraint"] = constraint.map() { $0.asJSON(errors: &errors) } @@ -3439,11 +3435,7 @@ open class ElementDefinition: Element { json["patternUri"] = patternUri.asJSON() } if let representation = self.representation { - var arr = [Any]() - for val in representation { - arr.append(val.asJSON()) - } - json["representation"] = arr + json["representation"] = representation.map() { $0.rawValue } } if let requirements = self.requirements { json["requirements"] = requirements.asJSON() @@ -3467,13 +3459,13 @@ open class ElementDefinition: Element { /** - * Base definition information for tools. - * - * Information about the base definition of the element, provided to make it unnecessary for tools to trace the - * deviation of the element through the derived and related profiles. This information is provided when the element - * definition is not the original definition of an element - i.g. either in a constraint on another type, or for - * elements from a super type in a snap shot. - */ +Base definition information for tools. + +Information about the base definition of the element, provided to make it unnecessary for tools to trace the deviation +of the element through the derived and related profiles. This information is provided when the element definition is not +the original definition of an element - i.g. either in a constraint on another type, or for elements from a super type +in a snap shot. +*/ open class ElementDefinitionBase: Element { override open class var resourceType: String { get { return "ElementDefinitionBase" } @@ -3558,10 +3550,10 @@ open class ElementDefinitionBase: Element { /** - * ValueSet details if this is coded. - * - * Binds to a value set if this element is coded (code, Coding, CodeableConcept). - */ +ValueSet details if this is coded. + +Binds to a value set if this element is coded (code, Coding, CodeableConcept). +*/ open class ElementDefinitionBinding: Element { override open class var resourceType: String { get { return "ElementDefinitionBinding" } @@ -3570,8 +3562,9 @@ open class ElementDefinitionBinding: Element { /// Human explanation of the value set. public var description_fhir: String? - /// required | extensible | preferred | example. - public var strength: String? + /// Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the + /// provided value set must be adhered to in the instances. + public var strength: BindingStrength? /// Source of value set. public var valueSetReference: Reference? @@ -3581,7 +3574,7 @@ open class ElementDefinitionBinding: Element { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(strength: String) { + public convenience init(strength: BindingStrength) { self.init() self.strength = strength } @@ -3601,7 +3594,12 @@ open class ElementDefinitionBinding: Element { if let exist = json["strength"] { presentKeys.insert("strength") if let val = exist as? String { - self.strength = val + if let enumval = BindingStrength(rawValue: val) { + self.strength = enumval + } + else { + errors.append(FHIRValidationError(key: "strength", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "strength", wants: String.self, has: type(of: exist))) @@ -3643,7 +3641,7 @@ open class ElementDefinitionBinding: Element { json["description"] = description_fhir.asJSON() } if let strength = self.strength { - json["strength"] = strength.asJSON() + json["strength"] = strength.rawValue } if let valueSetReference = self.valueSetReference { json["valueSetReference"] = valueSetReference.asJSON(errors: &errors) @@ -3658,11 +3656,11 @@ open class ElementDefinitionBinding: Element { /** - * Condition that must evaluate to true. - * - * Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the - * context of the instance. - */ +Condition that must evaluate to true. + +Formal constraints such as co-occurrence and other constraints that can be computationally evaluated within the context +of the instance. +*/ open class ElementDefinitionConstraint: Element { override open class var resourceType: String { get { return "ElementDefinitionConstraint" } @@ -3680,8 +3678,8 @@ open class ElementDefinitionConstraint: Element { /// Why this constraint is necessary or appropriate. public var requirements: String? - /// error | warning. - public var severity: String? + /// Identifies the impact constraint violation has on the conformance of the instance. + public var severity: ConstraintSeverity? /// Reference to original source of constraint. public var source: URL? @@ -3691,7 +3689,7 @@ open class ElementDefinitionConstraint: Element { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(expression: String, human: String, key: String, severity: String) { + public convenience init(expression: String, human: String, key: String, severity: ConstraintSeverity) { self.init() self.expression = expression self.human = human @@ -3750,7 +3748,12 @@ open class ElementDefinitionConstraint: Element { if let exist = json["severity"] { presentKeys.insert("severity") if let val = exist as? String { - self.severity = val + if let enumval = ConstraintSeverity(rawValue: val) { + self.severity = enumval + } + else { + errors.append(FHIRValidationError(key: "severity", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "severity", wants: String.self, has: type(of: exist))) @@ -3796,7 +3799,7 @@ open class ElementDefinitionConstraint: Element { json["requirements"] = requirements.asJSON() } if let severity = self.severity { - json["severity"] = severity.asJSON() + json["severity"] = severity.rawValue } if let source = self.source { json["source"] = source.asJSON() @@ -3811,10 +3814,10 @@ open class ElementDefinitionConstraint: Element { /** - * Map element to another set of definitions. - * - * Identifies a concept from an external specification that roughly corresponds to this element. - */ +Map element to another set of definitions. + +Identifies a concept from an external specification that roughly corresponds to this element. +*/ open class ElementDefinitionMapping: Element { override open class var resourceType: String { get { return "ElementDefinitionMapping" } @@ -3895,14 +3898,14 @@ open class ElementDefinitionMapping: Element { /** - * This element is sliced - slices follow. - * - * Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there - * are multiple different constraints on a single element in the base resource). Slicing can be used in any resource - * that has cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any - * elements that come after this in the element sequence that have the same path, until a shorter path occurs (the - * shorter path terminates the set). - */ +This element is sliced - slices follow. + +Indicates that the element is sliced into a set of alternative definitions (i.e. in a structure definition, there are +multiple different constraints on a single element in the base resource). Slicing can be used in any resource that has +cardinality ..* on the base resource, or any resource with a choice of types. The set of slices is any elements that +come after this in the element sequence that have the same path, until a shorter path occurs (the shorter path +terminates the set). +*/ open class ElementDefinitionSlicing: Element { override open class var resourceType: String { get { return "ElementDefinitionSlicing" } @@ -3917,12 +3920,13 @@ open class ElementDefinitionSlicing: Element { /// If elements must be in same order as slices. public var ordered: Bool? - /// closed | open | openAtEnd. - public var rules: String? + /// Whether additional slices are allowed or not. When the slices are ordered, profile authors can also say that + /// additional slices are only allowed at the end. + public var rules: SlicingRules? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(rules: String) { + public convenience init(rules: SlicingRules) { self.init() self.rules = rules } @@ -3960,7 +3964,12 @@ open class ElementDefinitionSlicing: Element { if let exist = json["rules"] { presentKeys.insert("rules") if let val = exist as? String { - self.rules = val + if let enumval = SlicingRules(rawValue: val) { + self.rules = enumval + } + else { + errors.append(FHIRValidationError(key: "rules", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "rules", wants: String.self, has: type(of: exist))) @@ -3979,17 +3988,13 @@ open class ElementDefinitionSlicing: Element { json["description"] = description_fhir.asJSON() } if let discriminator = self.discriminator { - var arr = [Any]() - for val in discriminator { - arr.append(val.asJSON()) - } - json["discriminator"] = arr + json["discriminator"] = discriminator.map() { $0.asJSON() } } if let ordered = self.ordered { json["ordered"] = ordered.asJSON() } if let rules = self.rules { - json["rules"] = rules.asJSON() + json["rules"] = rules.rawValue } return json @@ -3998,17 +4003,18 @@ open class ElementDefinitionSlicing: Element { /** - * Data type and Profile for this element. - * - * The data type or resource that the value of this element is permitted to be. - */ +Data type and Profile for this element. + +The data type or resource that the value of this element is permitted to be. +*/ open class ElementDefinitionType: Element { override open class var resourceType: String { get { return "ElementDefinitionType" } } - /// contained | referenced | bundled - how aggregated. - public var aggregation: [String]? + /// If the type is a reference to another resource, how the resource is or can be aggregated - is it a contained + /// resource, or a reference, and if the context is a bundle, is it included in the bundle. + public var aggregation: [AggregationMode]? /// Data type or Resource (reference to definition). public var code: URL? @@ -4019,8 +4025,8 @@ open class ElementDefinitionType: Element { /// Profile (StructureDefinition) to apply to reference target (or IG). public var targetProfile: URL? - /// either | independent | specific. - public var versioning: String? + /// Whether this reference needs to be version specific or version independent, or whetehr either can be used. + public var versioning: ReferenceVersionRules? /** Convenience initializer, taking all required properties as arguments. */ @@ -4034,8 +4040,12 @@ open class ElementDefinitionType: Element { var errors = try super.populate(from: json, presentKeys: &presentKeys) ?? [FHIRValidationError]() if let exist = json["aggregation"] { presentKeys.insert("aggregation") - if let val = exist as? [String] { - self.aggregation = val + if let val = exist as? [String] { var i = -1 + self.aggregation = val.map() { i += 1 + if let enumval = AggregationMode(rawValue: $0) { return enumval } + errors.append(FHIRValidationError(key: "aggregation.\(i)", problem: "the value “\(val)” is not valid")) + return nil + }.filter() { nil != $0 }.map() { $0! } } else { errors.append(FHIRValidationError(key: "aggregation", wants: Array.self, has: type(of: exist))) @@ -4074,7 +4084,12 @@ open class ElementDefinitionType: Element { if let exist = json["versioning"] { presentKeys.insert("versioning") if let val = exist as? String { - self.versioning = val + if let enumval = ReferenceVersionRules(rawValue: val) { + self.versioning = enumval + } + else { + errors.append(FHIRValidationError(key: "versioning", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "versioning", wants: String.self, has: type(of: exist))) @@ -4087,11 +4102,7 @@ open class ElementDefinitionType: Element { var json = super.asJSON(errors: &errors) if let aggregation = self.aggregation { - var arr = [Any]() - for val in aggregation { - arr.append(val.asJSON()) - } - json["aggregation"] = arr + json["aggregation"] = aggregation.map() { $0.rawValue } } if let code = self.code { json["code"] = code.asJSON() @@ -4103,7 +4114,7 @@ open class ElementDefinitionType: Element { json["targetProfile"] = targetProfile.asJSON() } if let versioning = self.versioning { - json["versioning"] = versioning.asJSON() + json["versioning"] = versioning.rawValue } return json diff --git a/Sources/Models/EligibilityRequest.swift b/Sources/Models/EligibilityRequest.swift index 0471fb18..1774f514 100644 --- a/Sources/Models/EligibilityRequest.swift +++ b/Sources/Models/EligibilityRequest.swift @@ -2,7 +2,7 @@ // EligibilityRequest.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/EligibilityRequest) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/EligibilityRequest) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Eligibility request. - * - * This resource provides the insurance eligibility details from the insurer regarding a specified coverage and - * optionally some class of service. - */ +Eligibility request. + +This resource provides the insurance eligibility details from the insurer regarding a specified coverage and optionally +some class of service. +*/ open class EligibilityRequest: DomainResource { override open class var resourceType: String { get { return "EligibilityRequest" } @@ -71,12 +71,12 @@ open class EligibilityRequest: DomainResource { /// Estimated date or dates of Service. public var servicedPeriod: Period? - /// active | cancelled | draft | entered-in-error. - public var status: String? + /// The status of the resource instance. + public var status: EligibilityRequestStatus? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: EligibilityRequestStatus) { self.init() self.status = status } @@ -310,7 +310,12 @@ open class EligibilityRequest: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = EligibilityRequestStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -377,7 +382,7 @@ open class EligibilityRequest: DomainResource { json["servicedPeriod"] = servicedPeriod.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } return json diff --git a/Sources/Models/EligibilityResponse.swift b/Sources/Models/EligibilityResponse.swift index 150f39fa..36b906b3 100644 --- a/Sources/Models/EligibilityResponse.swift +++ b/Sources/Models/EligibilityResponse.swift @@ -2,7 +2,7 @@ // EligibilityResponse.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/EligibilityResponse) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/EligibilityResponse) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * EligibilityResponse resource. - * - * This resource provides eligibility and plan details from the processing of an Eligibility resource. - */ +EligibilityResponse resource. + +This resource provides eligibility and plan details from the processing of an Eligibility resource. +*/ open class EligibilityResponse: DomainResource { override open class var resourceType: String { get { return "EligibilityResponse" } @@ -64,12 +64,12 @@ open class EligibilityResponse: DomainResource { /// Resource version. public var ruleset: Coding? - /// active | cancelled | draft | entered-in-error. - public var status: String? + /// The status of the resource instance. + public var status: EligibilityResponseStatus? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: EligibilityResponseStatus) { self.init() self.status = status } @@ -270,7 +270,12 @@ open class EligibilityResponse: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = EligibilityResponseStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -331,7 +336,7 @@ open class EligibilityResponse: DomainResource { json["ruleset"] = ruleset.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } return json @@ -340,10 +345,10 @@ open class EligibilityResponse: DomainResource { /** - * Benefits by Category. - * - * Benefits and optionally current balances by Category. - */ +Benefits by Category. + +Benefits and optionally current balances by Category. +*/ open class EligibilityResponseBenefitBalance: BackboneElement { override open class var resourceType: String { get { return "EligibilityResponseBenefitBalance" } @@ -525,10 +530,10 @@ open class EligibilityResponseBenefitBalance: BackboneElement { /** - * Benefit Summary. - * - * Benefits Used to date. - */ +Benefit Summary. + +Benefits Used to date. +*/ open class EligibilityResponseBenefitBalanceFinancial: BackboneElement { override open class var resourceType: String { get { return "EligibilityResponseBenefitBalanceFinancial" } @@ -665,10 +670,10 @@ open class EligibilityResponseBenefitBalanceFinancial: BackboneElement { /** - * Processing errors. - * - * Mutually exclusive with Services Provided (Item). - */ +Processing errors. + +Mutually exclusive with Services Provided (Item). +*/ open class EligibilityResponseError: BackboneElement { override open class var resourceType: String { get { return "EligibilityResponseError" } diff --git a/Sources/Models/Encounter.swift b/Sources/Models/Encounter.swift index 8830ec6e..06fd148c 100644 --- a/Sources/Models/Encounter.swift +++ b/Sources/Models/Encounter.swift @@ -2,7 +2,7 @@ // Encounter.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Encounter) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Encounter) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,25 +10,25 @@ import Foundation /** - * An interaction during which services are provided to the patient. - * - * An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or - * assessing the health status of a patient. - */ +An interaction during which services are provided to the patient. + +An interaction between a patient and healthcare provider(s) for the purpose of providing healthcare service(s) or +assessing the health status of a patient. +*/ open class Encounter: DomainResource { override open class var resourceType: String { get { return "Encounter" } } + /// inpatient | outpatient | ambulatory | emergency +. + public var `class`: Coding? + /// The set of accounts that may be used for billing for this Encounter. public var account: [Reference]? /// The appointment that scheduled this encounter. public var appointment: Reference? - /// inpatient | outpatient | ambulatory | emergency +. - public var class_fhir: Coding? - /// Episode(s) of care that this encounter should be recorded against. public var episodeOfCare: [Reference]? @@ -71,8 +71,8 @@ open class Encounter: DomainResource { /// The custodian organization of this Encounter record. public var serviceProvider: Reference? - /// planned | arrived | in-progress | onleave | finished | cancelled | entered-in-error. - public var status: String? + /// None + public var status: EncounterStatus? /// List of past encounter statuses. public var statusHistory: [EncounterStatusHistory]? @@ -82,7 +82,7 @@ open class Encounter: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: EncounterStatus) { self.init() self.status = status } @@ -90,6 +90,20 @@ open class Encounter: DomainResource { override open func populate(from json: FHIRJSON, presentKeys: inout Set) throws -> [FHIRValidationError]? { var errors = try super.populate(from: json, presentKeys: &presentKeys) ?? [FHIRValidationError]() + if let exist = json["class"] { + presentKeys.insert("class") + if let val = exist as? FHIRJSON { + do { + self.`class` = try Coding(json: val, owner: self) + } + catch let error as FHIRValidationError { + errors.append(error.prefixed(with: "class")) + } + } + else { + errors.append(FHIRValidationError(key: "class", wants: FHIRJSON.self, has: type(of: exist))) + } + } if let exist = json["account"] { presentKeys.insert("account") if let val = exist as? [FHIRJSON] { @@ -118,20 +132,6 @@ open class Encounter: DomainResource { errors.append(FHIRValidationError(key: "appointment", wants: FHIRJSON.self, has: type(of: exist))) } } - if let exist = json["class"] { - presentKeys.insert("class") - if let val = exist as? FHIRJSON { - do { - self.class_fhir = try Coding(json: val, owner: self) - } - catch let error as FHIRValidationError { - errors.append(error.prefixed(with: "class")) - } - } - else { - errors.append(FHIRValidationError(key: "class", wants: FHIRJSON.self, has: type(of: exist))) - } - } if let exist = json["episodeOfCare"] { presentKeys.insert("episodeOfCare") if let val = exist as? [FHIRJSON] { @@ -331,7 +331,12 @@ open class Encounter: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = EncounterStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -374,15 +379,15 @@ open class Encounter: DomainResource { override open func asJSON(errors: inout [FHIRValidationError]) -> FHIRJSON { var json = super.asJSON(errors: &errors) + if let `class` = self.`class` { + json["class"] = `class`.asJSON(errors: &errors) + } if let account = self.account { json["account"] = account.map() { $0.asJSON(errors: &errors) } } if let appointment = self.appointment { json["appointment"] = appointment.asJSON(errors: &errors) } - if let class_fhir = self.class_fhir { - json["class"] = class_fhir.asJSON(errors: &errors) - } if let episodeOfCare = self.episodeOfCare { json["episodeOfCare"] = episodeOfCare.map() { $0.asJSON(errors: &errors) } } @@ -426,7 +431,7 @@ open class Encounter: DomainResource { json["serviceProvider"] = serviceProvider.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let statusHistory = self.statusHistory { json["statusHistory"] = statusHistory.map() { $0.asJSON(errors: &errors) } @@ -441,8 +446,8 @@ open class Encounter: DomainResource { /** - * Details about the admission to a healthcare service. - */ +Details about the admission to a healthcare service. +*/ open class EncounterHospitalization: BackboneElement { override open class var resourceType: String { get { return "EncounterHospitalization" } @@ -460,7 +465,8 @@ open class EncounterHospitalization: BackboneElement { /// Diet preferences reported by the patient. public var dietPreference: [CodeableConcept]? - /// The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are complete. + /// The final diagnosis given a patient before release from the hospital after all testing, surgery, and workup are + /// complete. public var dischargeDiagnosis: [Reference]? /// Category or kind of location after discharge. @@ -472,7 +478,8 @@ open class EncounterHospitalization: BackboneElement { /// Pre-admission identifier. public var preAdmissionIdentifier: Identifier? - /// The type of hospital re-admission that has occurred (if any). If the value is absent, then this is not identified as a readmission. + /// The type of hospital re-admission that has occurred (if any). If the value is absent, then this is not + /// identified as a readmission. public var reAdmission: CodeableConcept? /// Wheelchair, translator, stretcher, etc.. @@ -684,10 +691,10 @@ open class EncounterHospitalization: BackboneElement { /** - * List of locations where the patient has been. - * - * List of locations where the patient has been during this encounter. - */ +List of locations where the patient has been. + +List of locations where the patient has been during this encounter. +*/ open class EncounterLocation: BackboneElement { override open class var resourceType: String { get { return "EncounterLocation" } @@ -699,8 +706,9 @@ open class EncounterLocation: BackboneElement { /// Time period during which the patient was present at the location. public var period: Period? - /// planned | active | reserved | completed. - public var status: String? + /// The status of the participants' presence at the specified location during the period specified. If the + /// participant is is no longer at the location, then the period will have an end date/time. + public var status: EncounterLocationStatus? /** Convenience initializer, taking all required properties as arguments. */ @@ -746,7 +754,12 @@ open class EncounterLocation: BackboneElement { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = EncounterLocationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -765,7 +778,7 @@ open class EncounterLocation: BackboneElement { json["period"] = period.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } return json @@ -774,10 +787,10 @@ open class EncounterLocation: BackboneElement { /** - * List of participants involved in the encounter. - * - * The list of people responsible for providing the service. - */ +List of participants involved in the encounter. + +The list of people responsible for providing the service. +*/ open class EncounterParticipant: BackboneElement { override open class var resourceType: String { get { return "EncounterParticipant" } @@ -859,11 +872,11 @@ open class EncounterParticipant: BackboneElement { /** - * List of past encounter statuses. - * - * The status history permits the encounter resource to contain the status history without needing to read through the - * historical versions of the resource, or even have the server store them. - */ +List of past encounter statuses. + +The status history permits the encounter resource to contain the status history without needing to read through the +historical versions of the resource, or even have the server store them. +*/ open class EncounterStatusHistory: BackboneElement { override open class var resourceType: String { get { return "EncounterStatusHistory" } @@ -872,12 +885,12 @@ open class EncounterStatusHistory: BackboneElement { /// The time that the episode was in the specified status. public var period: Period? - /// planned | arrived | in-progress | onleave | finished | cancelled | entered-in-error. - public var status: String? + /// None + public var status: EncounterStatus? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(period: Period, status: String) { + public convenience init(period: Period, status: EncounterStatus) { self.init() self.period = period self.status = status @@ -906,7 +919,12 @@ open class EncounterStatusHistory: BackboneElement { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = EncounterStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -925,7 +943,7 @@ open class EncounterStatusHistory: BackboneElement { json["period"] = period.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } return json diff --git a/Sources/Models/Endpoint.swift b/Sources/Models/Endpoint.swift index 7b7b3cc3..12255f04 100644 --- a/Sources/Models/Endpoint.swift +++ b/Sources/Models/Endpoint.swift @@ -2,7 +2,7 @@ // Endpoint.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Endpoint) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Endpoint) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * The technical details of an endpoint that can be used for electronic services. - * - * The technical details of an endpoint that can be used for electronic services, such as for web services providing - * XDS.b or a REST endpoint for another FHIR server. This may include any security context information. - */ +The technical details of an endpoint that can be used for electronic services. + +The technical details of an endpoint that can be used for electronic services, such as for web services providing XDS.b +or a REST endpoint for another FHIR server. This may include any security context information. +*/ open class Endpoint: DomainResource { override open class var resourceType: String { get { return "Endpoint" } @@ -41,7 +41,8 @@ open class Endpoint: DomainResource { /// A name that this endpoint can be identified by. public var name: String? - /// Mimetype to send. If not specified, the content could be anything (including no payload, if the connectionType defined this). + /// Mimetype to send. If not specified, the content could be anything (including no payload, if the connectionType + /// defined this). public var payloadMimeType: [String]? /// The type of content that may be used at this endpoint (e.g. XDS Discharge summaries). @@ -53,12 +54,12 @@ open class Endpoint: DomainResource { /// PKI Public keys to support secure communications. public var publicKey: String? - /// active | suspended | error | off | entered-in-error | test. - public var status: String? + /// active | suspended | error | off | test. + public var status: EndpointStatus? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(address: URL, connectionType: Coding, payloadType: [CodeableConcept], status: String) { + public convenience init(address: URL, connectionType: Coding, payloadType: [CodeableConcept], status: EndpointStatus) { self.init() self.address = address self.connectionType = connectionType @@ -210,7 +211,12 @@ open class Endpoint: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = EndpointStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -235,11 +241,7 @@ open class Endpoint: DomainResource { json["contact"] = contact.map() { $0.asJSON(errors: &errors) } } if let header = self.header { - var arr = [Any]() - for val in header { - arr.append(val.asJSON()) - } - json["header"] = arr + json["header"] = header.map() { $0.asJSON() } } if let identifier = self.identifier { json["identifier"] = identifier.map() { $0.asJSON(errors: &errors) } @@ -251,11 +253,7 @@ open class Endpoint: DomainResource { json["name"] = name.asJSON() } if let payloadMimeType = self.payloadMimeType { - var arr = [Any]() - for val in payloadMimeType { - arr.append(val.asJSON()) - } - json["payloadMimeType"] = arr + json["payloadMimeType"] = payloadMimeType.map() { $0.asJSON() } } if let payloadType = self.payloadType { json["payloadType"] = payloadType.map() { $0.asJSON(errors: &errors) } @@ -267,7 +265,7 @@ open class Endpoint: DomainResource { json["publicKey"] = publicKey.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } return json diff --git a/Sources/Models/EnrollmentRequest.swift b/Sources/Models/EnrollmentRequest.swift index 54b37f2c..1ebc3c95 100644 --- a/Sources/Models/EnrollmentRequest.swift +++ b/Sources/Models/EnrollmentRequest.swift @@ -2,7 +2,7 @@ // EnrollmentRequest.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/EnrollmentRequest) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/EnrollmentRequest) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Enrollment request. - * - * This resource provides the insurance enrollment details to the insurer regarding a specified coverage. - */ +Enrollment request. + +This resource provides the insurance enrollment details to the insurer regarding a specified coverage. +*/ open class EnrollmentRequest: DomainResource { override open class var resourceType: String { get { return "EnrollmentRequest" } @@ -52,8 +52,8 @@ open class EnrollmentRequest: DomainResource { /// Resource version. public var ruleset: Coding? - /// active | cancelled | draft | entered-in-error. - public var status: String? + /// The status of the resource instance. + public var status: EnrollmentRequestStatus? /// The subject of the Products and Services. public var subjectIdentifier: Identifier? @@ -63,7 +63,7 @@ open class EnrollmentRequest: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(coverage: Reference, status: String, subject: Any) { + public convenience init(coverage: Reference, status: EnrollmentRequestStatus, subject: Any) { self.init() self.coverage = coverage self.status = status @@ -236,7 +236,12 @@ open class EnrollmentRequest: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = EnrollmentRequestStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -318,7 +323,7 @@ open class EnrollmentRequest: DomainResource { json["ruleset"] = ruleset.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subjectIdentifier = self.subjectIdentifier { json["subjectIdentifier"] = subjectIdentifier.asJSON(errors: &errors) diff --git a/Sources/Models/EnrollmentResponse.swift b/Sources/Models/EnrollmentResponse.swift index 5ab733c6..20c9a1e2 100644 --- a/Sources/Models/EnrollmentResponse.swift +++ b/Sources/Models/EnrollmentResponse.swift @@ -2,7 +2,7 @@ // EnrollmentResponse.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/EnrollmentResponse) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/EnrollmentResponse) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * EnrollmentResponse resource. - * - * This resource provides enrollment and plan details from the processing of an Enrollment resource. - */ +EnrollmentResponse resource. + +This resource provides enrollment and plan details from the processing of an Enrollment resource. +*/ open class EnrollmentResponse: DomainResource { override open class var resourceType: String { get { return "EnrollmentResponse" } @@ -61,12 +61,12 @@ open class EnrollmentResponse: DomainResource { /// Resource version. public var ruleset: Coding? - /// active | cancelled | draft | entered-in-error. - public var status: String? + /// The status of the resource instance. + public var status: EnrollmentResponseStatus? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: EnrollmentResponseStatus) { self.init() self.status = status } @@ -258,7 +258,12 @@ open class EnrollmentResponse: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = EnrollmentResponseStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -316,7 +321,7 @@ open class EnrollmentResponse: DomainResource { json["ruleset"] = ruleset.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } return json diff --git a/Sources/Models/EpisodeOfCare.swift b/Sources/Models/EpisodeOfCare.swift index c98fce5c..66fb7265 100644 --- a/Sources/Models/EpisodeOfCare.swift +++ b/Sources/Models/EpisodeOfCare.swift @@ -2,7 +2,7 @@ // EpisodeOfCare.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/EpisodeOfCare) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/EpisodeOfCare) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,12 +10,12 @@ import Foundation /** - * An association of a Patient with an Organization and Healthcare Provider(s) for a period of time that the - * Organization assumes some level of responsibility. - * - * An association between a patient and an organization / healthcare provider(s) during which time encounters may - * occur. The managing organization assumes a level of responsibility for the patient during this time. - */ +An association of a Patient with an Organization and Healthcare Provider(s) for a period of time that the Organization +assumes some level of responsibility. + +An association between a patient and an organization / healthcare provider(s) during which time encounters may occur. +The managing organization assumes a level of responsibility for the patient during this time. +*/ open class EpisodeOfCare: DomainResource { override open class var resourceType: String { get { return "EpisodeOfCare" } @@ -45,8 +45,8 @@ open class EpisodeOfCare: DomainResource { /// Originating Referral Request(s). public var referralRequest: [Reference]? - /// planned | waitlist | active | onhold | finished | cancelled | entered-in-error. - public var status: String? + /// planned | waitlist | active | onhold | finished | cancelled. + public var status: EpisodeOfCareStatus? /// Past list of status codes. public var statusHistory: [EpisodeOfCareStatusHistory]? @@ -59,7 +59,7 @@ open class EpisodeOfCare: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(patient: Reference, status: String) { + public convenience init(patient: Reference, status: EpisodeOfCareStatus) { self.init() self.patient = patient self.status = status @@ -186,7 +186,12 @@ open class EpisodeOfCare: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = EpisodeOfCareStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -268,7 +273,7 @@ open class EpisodeOfCare: DomainResource { json["referralRequest"] = referralRequest.map() { $0.asJSON(errors: &errors) } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let statusHistory = self.statusHistory { json["statusHistory"] = statusHistory.map() { $0.asJSON(errors: &errors) } @@ -286,11 +291,11 @@ open class EpisodeOfCare: DomainResource { /** - * Past list of status codes. - * - * The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the - * resource). - */ +Past list of status codes. + +The history of statuses that the EpisodeOfCare has been through (without requiring processing the history of the +resource). +*/ open class EpisodeOfCareStatusHistory: BackboneElement { override open class var resourceType: String { get { return "EpisodeOfCareStatusHistory" } @@ -299,12 +304,12 @@ open class EpisodeOfCareStatusHistory: BackboneElement { /// Period for the status. public var period: Period? - /// planned | waitlist | active | onhold | finished | cancelled | entered-in-error. - public var status: String? + /// planned | waitlist | active | onhold | finished | cancelled. + public var status: EpisodeOfCareStatus? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(period: Period, status: String) { + public convenience init(period: Period, status: EpisodeOfCareStatus) { self.init() self.period = period self.status = status @@ -333,7 +338,12 @@ open class EpisodeOfCareStatusHistory: BackboneElement { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = EpisodeOfCareStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -352,7 +362,7 @@ open class EpisodeOfCareStatusHistory: BackboneElement { json["period"] = period.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } return json diff --git a/Sources/Models/ExpansionProfile.swift b/Sources/Models/ExpansionProfile.swift index b6f4cfec..502a31cb 100644 --- a/Sources/Models/ExpansionProfile.swift +++ b/Sources/Models/ExpansionProfile.swift @@ -2,7 +2,7 @@ // ExpansionProfile.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ExpansionProfile) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ExpansionProfile) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Defines behaviour and contraints on the ValueSet Expansion operation. - * - * Resource to define constraints on the Expansion of a FHIR ValueSet. - */ +Defines behaviour and contraints on the ValueSet Expansion operation. + +Resource to define constraints on the Expansion of a FHIR ValueSet. +*/ open class ExpansionProfile: DomainResource { override open class var resourceType: String { get { return "ExpansionProfile" } @@ -76,8 +76,8 @@ open class ExpansionProfile: DomainResource { /// Name of the publisher (Organization or individual). public var publisher: String? - /// draft | active | retired. - public var status: String? + /// The status of this expansion profile. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Logical uri to reference this expansion profile (globally unique). public var url: URL? @@ -90,7 +90,7 @@ open class ExpansionProfile: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: PublicationStatus) { self.init() self.status = status } @@ -302,7 +302,12 @@ open class ExpansionProfile: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -407,7 +412,7 @@ open class ExpansionProfile: DomainResource { json["publisher"] = publisher.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let url = self.url { json["url"] = url.asJSON() @@ -425,11 +430,11 @@ open class ExpansionProfile: DomainResource { /** - * When the expansion profile imposes designation contraints. - * - * A set of criteria that provide the constraints imposed on the value set expansion by including or excluding - * designations. - */ +When the expansion profile imposes designation contraints. + +A set of criteria that provide the constraints imposed on the value set expansion by including or excluding +designations. +*/ open class ExpansionProfileDesignation: BackboneElement { override open class var resourceType: String { get { return "ExpansionProfileDesignation" } @@ -491,8 +496,8 @@ open class ExpansionProfileDesignation: BackboneElement { /** - * Designations to be excluded. - */ +Designations to be excluded. +*/ open class ExpansionProfileDesignationExclude: BackboneElement { override open class var resourceType: String { get { return "ExpansionProfileDesignationExclude" } @@ -534,10 +539,10 @@ open class ExpansionProfileDesignationExclude: BackboneElement { /** - * The designation to be excluded. - * - * A data group for each designation to be excluded. - */ +The designation to be excluded. + +A data group for each designation to be excluded. +*/ open class ExpansionProfileDesignationExcludeDesignation: BackboneElement { override open class var resourceType: String { get { return "ExpansionProfileDesignationExcludeDesignation" } @@ -594,8 +599,8 @@ open class ExpansionProfileDesignationExcludeDesignation: BackboneElement { /** - * Designations to be included. - */ +Designations to be included. +*/ open class ExpansionProfileDesignationInclude: BackboneElement { override open class var resourceType: String { get { return "ExpansionProfileDesignationInclude" } @@ -637,10 +642,10 @@ open class ExpansionProfileDesignationInclude: BackboneElement { /** - * The designation to be included. - * - * A data group for each designation to be included. - */ +The designation to be included. + +A data group for each designation to be included. +*/ open class ExpansionProfileDesignationIncludeDesignation: BackboneElement { override open class var resourceType: String { get { return "ExpansionProfileDesignationIncludeDesignation" } @@ -697,10 +702,10 @@ open class ExpansionProfileDesignationIncludeDesignation: BackboneElement { /** - * Systems/Versions to be exclude. - * - * Code system, or a particular version of a code system to be excluded from value set expansions. - */ +Systems/Versions to be exclude. + +Code system, or a particular version of a code system to be excluded from value set expansions. +*/ open class ExpansionProfileExcludedSystem: BackboneElement { override open class var resourceType: String { get { return "ExpansionProfileExcludedSystem" } @@ -762,17 +767,18 @@ open class ExpansionProfileExcludedSystem: BackboneElement { /** - * Fix use of a code system to a particular version. - * - * Fix use of a particular code system to a particular version. - */ +Fix use of a code system to a particular version. + +Fix use of a particular code system to a particular version. +*/ open class ExpansionProfileFixedVersion: BackboneElement { override open class var resourceType: String { get { return "ExpansionProfileFixedVersion" } } - /// default | check | override. - public var mode: String? + /// How to manage the intersection between a fixed version in a value set, and this fixed version of the system in + /// the expansion profile. + public var mode: SystemVersionProcessingMode? /// System to have it's version fixed. public var system: URL? @@ -782,7 +788,7 @@ open class ExpansionProfileFixedVersion: BackboneElement { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(mode: String, system: URL, version: String) { + public convenience init(mode: SystemVersionProcessingMode, system: URL, version: String) { self.init() self.mode = mode self.system = system @@ -795,7 +801,12 @@ open class ExpansionProfileFixedVersion: BackboneElement { if let exist = json["mode"] { presentKeys.insert("mode") if let val = exist as? String { - self.mode = val + if let enumval = SystemVersionProcessingMode(rawValue: val) { + self.mode = enumval + } + else { + errors.append(FHIRValidationError(key: "mode", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "mode", wants: String.self, has: type(of: exist))) @@ -835,7 +846,7 @@ open class ExpansionProfileFixedVersion: BackboneElement { var json = super.asJSON(errors: &errors) if let mode = self.mode { - json["mode"] = mode.asJSON() + json["mode"] = mode.rawValue } if let system = self.system { json["system"] = system.asJSON() diff --git a/Sources/Models/ExplanationOfBenefit.swift b/Sources/Models/ExplanationOfBenefit.swift index fb11deea..2fbf93a7 100644 --- a/Sources/Models/ExplanationOfBenefit.swift +++ b/Sources/Models/ExplanationOfBenefit.swift @@ -2,7 +2,7 @@ // ExplanationOfBenefit.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ExplanationOfBenefit) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Explanation of Benefit resource. - * - * This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally - * account balance information, for informing the subscriber of the benefits provided. - */ +Explanation of Benefit resource. + +This resource provides: the claim details; adjudication details from the processing of a Claim; and optionally account +balance information, for informing the subscriber of the benefits provided. +*/ open class ExplanationOfBenefit: DomainResource { override open class var resourceType: String { get { return "ExplanationOfBenefit" } @@ -122,8 +122,8 @@ open class ExplanationOfBenefit: DomainResource { /// Current specification followed. public var ruleset: Coding? - /// active | cancelled | draft | entered-in-error. - public var status: String? + /// The status of the resource instance. + public var status: ExplanationOfBenefitStatus? /// Finer grained claim type information. public var subType: [Coding]? @@ -142,7 +142,7 @@ open class ExplanationOfBenefit: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(coverage: ExplanationOfBenefitCoverage, patient: Reference, status: String, type: Coding) { + public convenience init(coverage: ExplanationOfBenefitCoverage, patient: Reference, status: ExplanationOfBenefitStatus, type: Coding) { self.init() self.coverage = coverage self.patient = patient @@ -623,7 +623,12 @@ open class ExplanationOfBenefit: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = ExplanationOfBenefitStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -814,7 +819,7 @@ open class ExplanationOfBenefit: DomainResource { json["ruleset"] = ruleset.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subType = self.subType { json["subType"] = subType.map() { $0.asJSON(errors: &errors) } @@ -838,10 +843,10 @@ open class ExplanationOfBenefit: DomainResource { /** - * Details of an accident. - * - * An accident which resulted in the need for healthcare services. - */ +Details of an accident. + +An accident which resulted in the need for healthcare services. +*/ open class ExplanationOfBenefitAccident: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitAccident" } @@ -938,10 +943,10 @@ open class ExplanationOfBenefitAccident: BackboneElement { /** - * Insurer added line items. - * - * The first tier service adjudications for payor added services. - */ +Insurer added line items. + +The first tier service adjudications for payor added services. +*/ open class ExplanationOfBenefitAddItem: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitAddItem" } @@ -1115,21 +1120,13 @@ open class ExplanationOfBenefitAddItem: BackboneElement { json["modifier"] = modifier.map() { $0.asJSON(errors: &errors) } } if let noteNumber = self.noteNumber { - var arr = [Any]() - for val in noteNumber { - arr.append(val.asJSON()) - } - json["noteNumber"] = arr + json["noteNumber"] = noteNumber.map() { $0.asJSON() } } if let revenue = self.revenue { json["revenue"] = revenue.asJSON(errors: &errors) } if let sequenceLinkId = self.sequenceLinkId { - var arr = [Any]() - for val in sequenceLinkId { - arr.append(val.asJSON()) - } - json["sequenceLinkId"] = arr + json["sequenceLinkId"] = sequenceLinkId.map() { $0.asJSON() } } if let service = self.service { json["service"] = service.asJSON(errors: &errors) @@ -1141,10 +1138,10 @@ open class ExplanationOfBenefitAddItem: BackboneElement { /** - * Added items details. - * - * The second tier service adjudications for payor added services. - */ +Added items details. + +The second tier service adjudications for payor added services. +*/ open class ExplanationOfBenefitAddItemDetail: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitAddItemDetail" } @@ -1286,11 +1283,7 @@ open class ExplanationOfBenefitAddItemDetail: BackboneElement { json["modifier"] = modifier.map() { $0.asJSON(errors: &errors) } } if let noteNumber = self.noteNumber { - var arr = [Any]() - for val in noteNumber { - arr.append(val.asJSON()) - } - json["noteNumber"] = arr + json["noteNumber"] = noteNumber.map() { $0.asJSON() } } if let revenue = self.revenue { json["revenue"] = revenue.asJSON(errors: &errors) @@ -1305,8 +1298,8 @@ open class ExplanationOfBenefitAddItemDetail: BackboneElement { /** - * Balance by Benefit Category. - */ +Balance by Benefit Category. +*/ open class ExplanationOfBenefitBenefitBalance: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitBenefitBalance" } @@ -1488,10 +1481,10 @@ open class ExplanationOfBenefitBenefitBalance: BackboneElement { /** - * Benefit Summary. - * - * Benefits Used to date. - */ +Benefit Summary. + +Benefits Used to date. +*/ open class ExplanationOfBenefitBenefitBalanceFinancial: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitBenefitBalanceFinancial" } @@ -1628,10 +1621,10 @@ open class ExplanationOfBenefitBenefitBalanceFinancial: BackboneElement { /** - * Insurance or medical plan. - * - * Financial instrument by which payment information for health care. - */ +Insurance or medical plan. + +Financial instrument by which payment information for health care. +*/ open class ExplanationOfBenefitCoverage: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitCoverage" } @@ -1679,11 +1672,7 @@ open class ExplanationOfBenefitCoverage: BackboneElement { json["coverage"] = coverage.asJSON(errors: &errors) } if let preAuthRef = self.preAuthRef { - var arr = [Any]() - for val in preAuthRef { - arr.append(val.asJSON()) - } - json["preAuthRef"] = arr + json["preAuthRef"] = preAuthRef.map() { $0.asJSON() } } return json @@ -1692,10 +1681,10 @@ open class ExplanationOfBenefitCoverage: BackboneElement { /** - * Diagnosis. - * - * Ordered list of patient diagnosis for which care is sought. - */ +Diagnosis. + +Ordered list of patient diagnosis for which care is sought. +*/ open class ExplanationOfBenefitDiagnosis: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitDiagnosis" } @@ -1806,11 +1795,11 @@ open class ExplanationOfBenefitDiagnosis: BackboneElement { /** - * Exceptions, special considerations, the condition, situation, prior or concurrent issues. - * - * Additional information codes regarding exceptions, special considerations, the condition, situation, prior or - * concurrent issues. Often there are mutiple jurisdiction specific valuesets which are required. - */ +Exceptions, special considerations, the condition, situation, prior or concurrent issues. + +Additional information codes regarding exceptions, special considerations, the condition, situation, prior or concurrent +issues. Often there are mutiple jurisdiction specific valuesets which are required. +*/ open class ExplanationOfBenefitInformation: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitInformation" } @@ -1952,10 +1941,10 @@ open class ExplanationOfBenefitInformation: BackboneElement { /** - * Goods and Services. - * - * First tier of goods and services. - */ +Goods and Services. + +First tier of goods and services. +*/ open class ExplanationOfBenefitItem: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitItem" } @@ -2391,11 +2380,7 @@ open class ExplanationOfBenefitItem: BackboneElement { json["detail"] = detail.map() { $0.asJSON(errors: &errors) } } if let diagnosisLinkId = self.diagnosisLinkId { - var arr = [Any]() - for val in diagnosisLinkId { - arr.append(val.asJSON()) - } - json["diagnosisLinkId"] = arr + json["diagnosisLinkId"] = diagnosisLinkId.map() { $0.asJSON() } } if let factor = self.factor { json["factor"] = factor.asJSON() @@ -2416,11 +2401,7 @@ open class ExplanationOfBenefitItem: BackboneElement { json["net"] = net.asJSON(errors: &errors) } if let noteNumber = self.noteNumber { - var arr = [Any]() - for val in noteNumber { - arr.append(val.asJSON()) - } - json["noteNumber"] = arr + json["noteNumber"] = noteNumber.map() { $0.asJSON() } } if let points = self.points { json["points"] = points.asJSON() @@ -2465,10 +2446,10 @@ open class ExplanationOfBenefitItem: BackboneElement { /** - * Adjudication details. - * - * The adjudications results. - */ +Adjudication details. + +The adjudications results. +*/ open class ExplanationOfBenefitItemAdjudication: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitItemAdjudication" } @@ -2575,11 +2556,11 @@ open class ExplanationOfBenefitItemAdjudication: BackboneElement { /** - * Care Team members. - * - * The members of the team who provided the overall service as well as their role and whether responsible and - * qualifications. - */ +Care Team members. + +The members of the team who provided the overall service as well as their role and whether responsible and +qualifications. +*/ open class ExplanationOfBenefitItemCareTeam: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitItemCareTeam" } @@ -2686,10 +2667,10 @@ open class ExplanationOfBenefitItemCareTeam: BackboneElement { /** - * Additional items. - * - * Second tier of goods and services. - */ +Additional items. + +Second tier of goods and services. +*/ open class ExplanationOfBenefitItemDetail: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitItemDetail" } @@ -2986,11 +2967,7 @@ open class ExplanationOfBenefitItemDetail: BackboneElement { json["net"] = net.asJSON(errors: &errors) } if let noteNumber = self.noteNumber { - var arr = [Any]() - for val in noteNumber { - arr.append(val.asJSON()) - } - json["noteNumber"] = arr + json["noteNumber"] = noteNumber.map() { $0.asJSON() } } if let points = self.points { json["points"] = points.asJSON() @@ -3029,10 +3006,10 @@ open class ExplanationOfBenefitItemDetail: BackboneElement { /** - * Additional items. - * - * Third tier of goods and services. - */ +Additional items. + +Third tier of goods and services. +*/ open class ExplanationOfBenefitItemDetailSubDetail: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitItemDetailSubDetail" } @@ -3312,11 +3289,7 @@ open class ExplanationOfBenefitItemDetailSubDetail: BackboneElement { json["net"] = net.asJSON(errors: &errors) } if let noteNumber = self.noteNumber { - var arr = [Any]() - for val in noteNumber { - arr.append(val.asJSON()) - } - json["noteNumber"] = arr + json["noteNumber"] = noteNumber.map() { $0.asJSON() } } if let points = self.points { json["points"] = points.asJSON() @@ -3352,10 +3325,10 @@ open class ExplanationOfBenefitItemDetailSubDetail: BackboneElement { /** - * Prosthetic details. - * - * The materials and placement date of prior fixed prosthesis. - */ +Prosthetic details. + +The materials and placement date of prior fixed prosthesis. +*/ open class ExplanationOfBenefitItemProsthesis: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitItemProsthesis" } @@ -3427,11 +3400,10 @@ open class ExplanationOfBenefitItemProsthesis: BackboneElement { /** - * Only if type = oral. - * - * A list of teeth which would be expected but are not found due to having been previously extracted or for other - * reasons. - */ +Only if type = oral. + +A list of teeth which would be expected but are not found due to having been previously extracted or for other reasons. +*/ open class ExplanationOfBenefitMissingTeeth: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitMissingTeeth" } @@ -3518,10 +3490,10 @@ open class ExplanationOfBenefitMissingTeeth: BackboneElement { /** - * Processing notes. - * - * Note text. - */ +Processing notes. + +Note text. +*/ open class ExplanationOfBenefitNote: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitNote" } @@ -3613,10 +3585,10 @@ open class ExplanationOfBenefitNote: BackboneElement { /** - * Payee. - * - * The party to be reimbursed for the services. - */ +Payee. + +The party to be reimbursed for the services. +*/ open class ExplanationOfBenefitPayee: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitPayee" } @@ -3718,10 +3690,10 @@ open class ExplanationOfBenefitPayee: BackboneElement { /** - * Payment (if paid). - * - * Payment details for the claim if the claim has been paid. - */ +Payment (if paid). + +Payment details for the claim if the claim has been paid. +*/ open class ExplanationOfBenefitPayment: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitPayment" } @@ -3858,10 +3830,10 @@ open class ExplanationOfBenefitPayment: BackboneElement { /** - * Procedures performed. - * - * Ordered list of patient procedures performed to support the adjudication. - */ +Procedures performed. + +Ordered list of patient procedures performed to support the adjudication. +*/ open class ExplanationOfBenefitProcedure: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitProcedure" } @@ -3977,10 +3949,10 @@ open class ExplanationOfBenefitProcedure: BackboneElement { /** - * Related Claims which may be revelant to processing this claimn. - * - * Other claims which are related to this claim such as prior claim versions or for related services. - */ +Related Claims which may be revelant to processing this claimn. + +Other claims which are related to this claim such as prior claim versions or for related services. +*/ open class ExplanationOfBenefitRelated: BackboneElement { override open class var resourceType: String { get { return "ExplanationOfBenefitRelated" } diff --git a/Sources/Models/Extension.swift b/Sources/Models/Extension.swift index 064b758a..af8cd8bc 100644 --- a/Sources/Models/Extension.swift +++ b/Sources/Models/Extension.swift @@ -2,7 +2,7 @@ // Extension.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Extension) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Extension) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Optional Extensions Element. - * - * Optional Extensions Element - found in all resources. - */ +Optional Extensions Element. + +Optional Extensions Element - found in all resources. +*/ open class Extension: Element { override open class var resourceType: String { get { return "Extension" } diff --git a/Sources/Models/FHIRAbstractBase+Factory.swift b/Sources/Models/FHIRAbstractBase+Factory.swift index 8290ad91..11787bdc 100644 --- a/Sources/Models/FHIRAbstractBase+Factory.swift +++ b/Sources/Models/FHIRAbstractBase+Factory.swift @@ -2,7 +2,7 @@ // FHIRAbstractBase+Factory.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // diff --git a/Sources/Models/FamilyMemberHistory.swift b/Sources/Models/FamilyMemberHistory.swift index c3d4b59a..f7245864 100644 --- a/Sources/Models/FamilyMemberHistory.swift +++ b/Sources/Models/FamilyMemberHistory.swift @@ -2,7 +2,7 @@ // FamilyMemberHistory.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/FamilyMemberHistory) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Information about patient's relatives, relevant for patient. - * - * Significant health events and conditions for a person related to the patient relevant in the context of care for the - * patient. - */ +Information about patient's relatives, relevant for patient. + +Significant health events and conditions for a person related to the patient relevant in the context of care for the +patient. +*/ open class FamilyMemberHistory: DomainResource { override open class var resourceType: String { get { return "FamilyMemberHistory" } @@ -62,8 +62,9 @@ open class FamilyMemberHistory: DomainResource { /// Age is estimated?. public var estimatedAge: Bool? - /// male | female | other | unknown. - public var gender: String? + /// Administrative Gender - the gender that the relative is considered to have for administration and record keeping + /// purposes. + public var gender: AdministrativeGender? /// External Id(s) for this record. public var identifier: [Identifier]? @@ -80,12 +81,12 @@ open class FamilyMemberHistory: DomainResource { /// Relationship to the subject. public var relationship: CodeableConcept? - /// partial | completed | entered-in-error | health-unknown. - public var status: String? + /// A code specifying the status of the record of the family history of a specific family member. + public var status: FamilyHistoryStatus? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(patient: Reference, relationship: CodeableConcept, status: String) { + public convenience init(patient: Reference, relationship: CodeableConcept, status: FamilyHistoryStatus) { self.init() self.patient = patient self.relationship = relationship @@ -254,7 +255,12 @@ open class FamilyMemberHistory: DomainResource { if let exist = json["gender"] { presentKeys.insert("gender") if let val = exist as? String { - self.gender = val + if let enumval = AdministrativeGender(rawValue: val) { + self.gender = enumval + } + else { + errors.append(FHIRValidationError(key: "gender", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "gender", wants: String.self, has: type(of: exist))) @@ -334,7 +340,12 @@ open class FamilyMemberHistory: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = FamilyHistoryStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -392,7 +403,7 @@ open class FamilyMemberHistory: DomainResource { json["estimatedAge"] = estimatedAge.asJSON() } if let gender = self.gender { - json["gender"] = gender.asJSON() + json["gender"] = gender.rawValue } if let identifier = self.identifier { json["identifier"] = identifier.map() { $0.asJSON(errors: &errors) } @@ -410,7 +421,7 @@ open class FamilyMemberHistory: DomainResource { json["relationship"] = relationship.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } return json @@ -419,12 +430,11 @@ open class FamilyMemberHistory: DomainResource { /** - * Condition that the related person had. - * - * The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system - * to represent more than one condition per resource, though there is nothing stopping multiple resources - one per - * condition. - */ +Condition that the related person had. + +The significant Conditions (or condition) that the family member had. This is a repeating section to allow a system to +represent more than one condition per resource, though there is nothing stopping multiple resources - one per condition. +*/ open class FamilyMemberHistoryCondition: BackboneElement { override open class var resourceType: String { get { return "FamilyMemberHistoryCondition" } diff --git a/Sources/Models/Flag.swift b/Sources/Models/Flag.swift index a9d9501e..3a37cd3a 100644 --- a/Sources/Models/Flag.swift +++ b/Sources/Models/Flag.swift @@ -2,7 +2,7 @@ // Flag.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Flag) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Flag) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Key information to flag to healthcare providers. - * - * Prospective warnings of potential issues when providing care to the patient. - */ +Key information to flag to healthcare providers. + +Prospective warnings of potential issues when providing care to the patient. +*/ open class Flag: DomainResource { override open class var resourceType: String { get { return "Flag" } @@ -37,15 +37,15 @@ open class Flag: DomainResource { /// Time period when flag is active. public var period: Period? - /// active | inactive | entered-in-error. - public var status: String? + /// Supports basic workflow. + public var status: FlagStatus? /// Who/What is flag about?. public var subject: Reference? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(code: CodeableConcept, status: String, subject: Reference) { + public convenience init(code: CodeableConcept, status: FlagStatus, subject: Reference) { self.init() self.code = code self.status = status @@ -145,7 +145,12 @@ open class Flag: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = FlagStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -196,7 +201,7 @@ open class Flag: DomainResource { json["period"] = period.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) diff --git a/Sources/Models/Goal.swift b/Sources/Models/Goal.swift index 9b9fdc29..5448128d 100644 --- a/Sources/Models/Goal.swift +++ b/Sources/Models/Goal.swift @@ -2,7 +2,7 @@ // Goal.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Goal) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Goal) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Describes the intended objective(s) for a patient, group or organization. - * - * Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring - * an activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. - */ +Describes the intended objective(s) for a patient, group or organization. + +Describes the intended objective(s) for a patient, group or organization care, for example, weight loss, restoring an +activity of daily living, obtaining herd immunity via immunization, meeting a process improvement objective, etc. +*/ open class Goal: DomainResource { override open class var resourceType: String { get { return "Goal" } @@ -50,8 +50,8 @@ open class Goal: DomainResource { /// When goal pursuit begins. public var startDate: FHIRDate? - /// proposed | planned | accepted | rejected | in-progress | achieved | sustaining | on-hold | cancelled | on-target | ahead-of-target | behind-target | entered-in-error. - public var status: String? + /// Indicates whether the goal has been reached and is still considered relevant. + public var status: GoalStatus? /// When goal status took effect. public var statusDate: FHIRDate? @@ -70,7 +70,7 @@ open class Goal: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(description_fhir: CodeableConcept, status: String) { + public convenience init(description_fhir: CodeableConcept, status: GoalStatus) { self.init() self.description_fhir = description_fhir self.status = status @@ -220,7 +220,12 @@ open class Goal: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = GoalStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -326,7 +331,7 @@ open class Goal: DomainResource { json["startDate"] = startDate.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let statusDate = self.statusDate { json["statusDate"] = statusDate.asJSON() @@ -350,10 +355,10 @@ open class Goal: DomainResource { /** - * What result was achieved regarding the goal?. - * - * Identifies the change (or lack of change) at the point where the goal was deemed to be cancelled or achieved. - */ +What result was achieved regarding the goal?. + +Identifies the change (or lack of change) at the point where the goal was deemed to be cancelled or achieved. +*/ open class GoalOutcome: BackboneElement { override open class var resourceType: String { get { return "GoalOutcome" } diff --git a/Sources/Models/Group.swift b/Sources/Models/Group.swift index fc5652dc..bdbfd397 100644 --- a/Sources/Models/Group.swift +++ b/Sources/Models/Group.swift @@ -2,7 +2,7 @@ // Group.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Group) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Group) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,12 +10,12 @@ import Foundation /** - * Group of multiple entities. - * - * Represents a defined collection of entities that may be discussed or acted upon collectively but which are not - * expected to act collectively and are not formally or legally recognized; i.e. a collection of entities that isn't an - * Organization. - */ +Group of multiple entities. + +Represents a defined collection of entities that may be discussed or acted upon collectively but which are not expected +to act collectively and are not formally or legally recognized; i.e. a collection of entities that isn't an +Organization. +*/ open class Group: DomainResource { override open class var resourceType: String { get { return "Group" } @@ -45,12 +45,12 @@ open class Group: DomainResource { /// Number of members. public var quantity: UInt? - /// person | animal | practitioner | device | medication | substance. - public var type: String? + /// Identifies the broad classification of the kind of resources the group includes. + public var type: GroupType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(actual: Bool, type: String) { + public convenience init(actual: Bool, type: GroupType) { self.init() self.actual = actual self.type = type @@ -157,7 +157,12 @@ open class Group: DomainResource { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = GroupType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -197,7 +202,7 @@ open class Group: DomainResource { json["quantity"] = quantity.asJSON() } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json @@ -206,10 +211,10 @@ open class Group: DomainResource { /** - * Trait of group members. - * - * Identifies the traits shared by members of the group. - */ +Trait of group members. + +Identifies the traits shared by members of the group. +*/ open class GroupCharacteristic: BackboneElement { override open class var resourceType: String { get { return "GroupCharacteristic" } @@ -395,10 +400,10 @@ open class GroupCharacteristic: BackboneElement { /** - * Who or what is in group. - * - * Identifies the resource instances that are members of the group. - */ +Who or what is in group. + +Identifies the resource instances that are members of the group. +*/ open class GroupMember: BackboneElement { override open class var resourceType: String { get { return "GroupMember" } diff --git a/Sources/Models/GuidanceResponse.swift b/Sources/Models/GuidanceResponse.swift index 9477b568..ca4c3fc3 100644 --- a/Sources/Models/GuidanceResponse.swift +++ b/Sources/Models/GuidanceResponse.swift @@ -2,7 +2,7 @@ // GuidanceResponse.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/GuidanceResponse) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/GuidanceResponse) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * The formal response to a guidance request. - * - * A guidance response is the formal response to a guidance request, including any output parameters returned by the - * evaluation, as well as the description of any proposed actions to be taken. - */ +The formal response to a guidance request. + +A guidance response is the formal response to a guidance request, including any output parameters returned by the +evaluation, as well as the description of any proposed actions to be taken. +*/ open class GuidanceResponse: DomainResource { override open class var resourceType: String { get { return "GuidanceResponse" } @@ -59,15 +59,20 @@ open class GuidanceResponse: DomainResource { /// The id of the request associated with this response, if any. public var requestId: String? - /// success | data-requested | data-required | in-progress | failure. - public var status: String? + /// The status of the response. If the evaluation is completed successfully, the status will indicate success. + /// However, in order to complete the evaluation, the engine may require more information. In this case, the status + /// will be data-required, and the response will contain a description of the additional required information. If + /// the evaluation completed successfully, but the engine determines that a potentially more accurate response could + /// be provided if more data was available, the status will be data-requested, and the response will contain a + /// description of the additional requested information. + public var status: GuidanceResponseStatus? /// Patient the request was performed for. public var subject: Reference? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(module: Reference, status: String) { + public convenience init(module: Reference, status: GuidanceResponseStatus) { self.init() self.module = module self.status = status @@ -254,7 +259,12 @@ open class GuidanceResponse: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = GuidanceResponseStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -323,7 +333,7 @@ open class GuidanceResponse: DomainResource { json["requestId"] = requestId.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) diff --git a/Sources/Models/HealthcareService.swift b/Sources/Models/HealthcareService.swift index 5e9f20db..a902ab76 100644 --- a/Sources/Models/HealthcareService.swift +++ b/Sources/Models/HealthcareService.swift @@ -2,7 +2,7 @@ // HealthcareService.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/HealthcareService) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/HealthcareService) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,8 +10,8 @@ import Foundation /** - * The details of a healthcare service available at a location. - */ +The details of a healthcare service available at a location. +*/ open class HealthcareService: DomainResource { override open class var resourceType: String { get { return "HealthcareService" } @@ -432,11 +432,7 @@ open class HealthcareService: DomainResource { json["photo"] = photo.asJSON(errors: &errors) } if let programName = self.programName { - var arr = [Any]() - for val in programName { - arr.append(val.asJSON()) - } - json["programName"] = arr + json["programName"] = programName.map() { $0.asJSON() } } if let providedBy = self.providedBy { json["providedBy"] = providedBy.asJSON(errors: &errors) @@ -472,10 +468,10 @@ open class HealthcareService: DomainResource { /** - * Times the Service Site is available. - * - * A collection of times that the Service Site is available. - */ +Times the Service Site is available. + +A collection of times that the Service Site is available. +*/ open class HealthcareServiceAvailableTime: BackboneElement { override open class var resourceType: String { get { return "HealthcareServiceAvailableTime" } @@ -490,8 +486,8 @@ open class HealthcareServiceAvailableTime: BackboneElement { /// Opening time of day (ignored if allDay = true). public var availableStartTime: FHIRTime? - /// mon | tue | wed | thu | fri | sat | sun. - public var daysOfWeek: [String]? + /// Indicates which days of the week are available between the start and end Times. + public var daysOfWeek: [DaysOfWeek]? override open func populate(from json: FHIRJSON, presentKeys: inout Set) throws -> [FHIRValidationError]? { @@ -525,8 +521,12 @@ open class HealthcareServiceAvailableTime: BackboneElement { } if let exist = json["daysOfWeek"] { presentKeys.insert("daysOfWeek") - if let val = exist as? [String] { - self.daysOfWeek = val + if let val = exist as? [String] { var i = -1 + self.daysOfWeek = val.map() { i += 1 + if let enumval = DaysOfWeek(rawValue: $0) { return enumval } + errors.append(FHIRValidationError(key: "daysOfWeek.\(i)", problem: "the value “\(val)” is not valid")) + return nil + }.filter() { nil != $0 }.map() { $0! } } else { errors.append(FHIRValidationError(key: "daysOfWeek", wants: Array.self, has: type(of: exist))) @@ -548,11 +548,7 @@ open class HealthcareServiceAvailableTime: BackboneElement { json["availableStartTime"] = availableStartTime.asJSON() } if let daysOfWeek = self.daysOfWeek { - var arr = [Any]() - for val in daysOfWeek { - arr.append(val.asJSON()) - } - json["daysOfWeek"] = arr + json["daysOfWeek"] = daysOfWeek.map() { $0.rawValue } } return json @@ -561,10 +557,10 @@ open class HealthcareServiceAvailableTime: BackboneElement { /** - * Not available during this time due to provided reason. - * - * The HealthcareService is not available during this period of time due to the provided reason. - */ +Not available during this time due to provided reason. + +The HealthcareService is not available during this period of time due to the provided reason. +*/ open class HealthcareServiceNotAvailable: BackboneElement { override open class var resourceType: String { get { return "HealthcareServiceNotAvailable" } diff --git a/Sources/Models/HumanName.swift b/Sources/Models/HumanName.swift index 8c69072e..b6d860ba 100644 --- a/Sources/Models/HumanName.swift +++ b/Sources/Models/HumanName.swift @@ -2,7 +2,7 @@ // HumanName.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/HumanName) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/HumanName) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Name of a human - parts and usage. - * - * A human's name with the ability to identify parts and usage. - */ +Name of a human - parts and usage. + +A human's name with the ability to identify parts and usage. +*/ open class HumanName: Element { override open class var resourceType: String { get { return "HumanName" } @@ -37,8 +37,8 @@ open class HumanName: Element { /// Text representation of the full name. public var text: String? - /// usual | official | temp | nickname | anonymous | old | maiden. - public var use: String? + /// Identifies the purpose for this name. + public var use: NameUse? override open func populate(from json: FHIRJSON, presentKeys: inout Set) throws -> [FHIRValidationError]? { @@ -105,7 +105,12 @@ open class HumanName: Element { if let exist = json["use"] { presentKeys.insert("use") if let val = exist as? String { - self.use = val + if let enumval = NameUse(rawValue: val) { + self.use = enumval + } + else { + errors.append(FHIRValidationError(key: "use", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "use", wants: String.self, has: type(of: exist))) @@ -118,41 +123,25 @@ open class HumanName: Element { var json = super.asJSON(errors: &errors) if let family = self.family { - var arr = [Any]() - for val in family { - arr.append(val.asJSON()) - } - json["family"] = arr + json["family"] = family.map() { $0.asJSON() } } if let given = self.given { - var arr = [Any]() - for val in given { - arr.append(val.asJSON()) - } - json["given"] = arr + json["given"] = given.map() { $0.asJSON() } } if let period = self.period { json["period"] = period.asJSON(errors: &errors) } if let prefix = self.prefix { - var arr = [Any]() - for val in prefix { - arr.append(val.asJSON()) - } - json["prefix"] = arr + json["prefix"] = prefix.map() { $0.asJSON() } } if let suffix = self.suffix { - var arr = [Any]() - for val in suffix { - arr.append(val.asJSON()) - } - json["suffix"] = arr + json["suffix"] = suffix.map() { $0.asJSON() } } if let text = self.text { json["text"] = text.asJSON() } if let use = self.use { - json["use"] = use.asJSON() + json["use"] = use.rawValue } return json diff --git a/Sources/Models/Identifier.swift b/Sources/Models/Identifier.swift index 5e680205..595acfa7 100644 --- a/Sources/Models/Identifier.swift +++ b/Sources/Models/Identifier.swift @@ -2,7 +2,7 @@ // Identifier.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Identifier) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Identifier) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * An identifier intended for computation. - * - * A technical identifier - identifies some entity uniquely and unambiguously. - */ +An identifier intended for computation. + +A technical identifier - identifies some entity uniquely and unambiguously. +*/ open class Identifier: Element { override open class var resourceType: String { get { return "Identifier" } @@ -31,8 +31,8 @@ open class Identifier: Element { /// Description of identifier. public var type: CodeableConcept? - /// usual | official | temp | secondary (If known). - public var use: String? + /// The purpose of this identifier. + public var use: IdentifierUse? /// The value that is unique. public var value: String? @@ -94,7 +94,12 @@ open class Identifier: Element { if let exist = json["use"] { presentKeys.insert("use") if let val = exist as? String { - self.use = val + if let enumval = IdentifierUse(rawValue: val) { + self.use = enumval + } + else { + errors.append(FHIRValidationError(key: "use", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "use", wants: String.self, has: type(of: exist))) @@ -128,7 +133,7 @@ open class Identifier: Element { json["type"] = type.asJSON(errors: &errors) } if let use = self.use { - json["use"] = use.asJSON() + json["use"] = use.rawValue } if let value = self.value { json["value"] = value.asJSON() diff --git a/Sources/Models/ImagingManifest.swift b/Sources/Models/ImagingManifest.swift index 611709c4..be53e4ce 100644 --- a/Sources/Models/ImagingManifest.swift +++ b/Sources/Models/ImagingManifest.swift @@ -2,7 +2,7 @@ // ImagingManifest.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ImagingManifest) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ImagingManifest) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,16 +10,16 @@ import Foundation /** - * Key Object Selection. - * - * A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or - * other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances may have - * been selected for a purpose, such as conference, or consult. Reflecting a range of sharing purposes, typical - * ImagingManifest resources may include all SOP Instances in a study (perhaps for sharing through a Health Information - * Exchange); key images from multiple studies (for reference by a referring or treating physician); both a multi-frame - * ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a - * teaching file); and so on. - */ +Key Object Selection. + +A manifest of a set of DICOM Service-Object Pair Instances (SOP Instances). The referenced SOP Instances (images or +other content) are for a single patient, and may be from one or more studies. The referenced SOP Instances may have been +selected for a purpose, such as conference, or consult. Reflecting a range of sharing purposes, typical +ImagingManifest resources may include all SOP Instances in a study (perhaps for sharing through a Health Information +Exchange); key images from multiple studies (for reference by a referring or treating physician); both a multi-frame +ultrasound instance ("cine" video clip) and a set of measurements taken from that instance (for inclusion in a teaching +file); and so on. +*/ open class ImagingManifest: DomainResource { override open class var resourceType: String { get { return "ImagingManifest" } @@ -184,10 +184,10 @@ open class ImagingManifest: DomainResource { /** - * Study identity of the selected instances. - * - * Study identity and locating information of the DICOM SOP instances in the selection. - */ +Study identity of the selected instances. + +Study identity and locating information of the DICOM SOP instances in the selection. +*/ open class ImagingManifestStudy: BackboneElement { override open class var resourceType: String { get { return "ImagingManifestStudy" } @@ -298,10 +298,10 @@ open class ImagingManifestStudy: BackboneElement { /** - * Study access service endpoint. - * - * Methods of accessing (e.g., retrieving, viewing) the study. - */ +Study access service endpoint. + +Methods of accessing (e.g., retrieving, viewing) the study. +*/ open class ImagingManifestStudyBaseLocation: BackboneElement { override open class var resourceType: String { get { return "ImagingManifestStudyBaseLocation" } @@ -372,10 +372,10 @@ open class ImagingManifestStudyBaseLocation: BackboneElement { /** - * Series identity of the selected instances. - * - * Series identity and locating information of the DICOM SOP instances in the selection. - */ +Series identity of the selected instances. + +Series identity and locating information of the DICOM SOP instances in the selection. +*/ open class ImagingManifestStudySeries: BackboneElement { override open class var resourceType: String { get { return "ImagingManifestStudySeries" } @@ -466,10 +466,10 @@ open class ImagingManifestStudySeries: BackboneElement { /** - * Series access endpoint. - * - * Methods of accessing (e.g. retrieving) the series. - */ +Series access endpoint. + +Methods of accessing (e.g. retrieving) the series. +*/ open class ImagingManifestStudySeriesBaseLocation: BackboneElement { override open class var resourceType: String { get { return "ImagingManifestStudySeriesBaseLocation" } @@ -540,10 +540,10 @@ open class ImagingManifestStudySeriesBaseLocation: BackboneElement { /** - * The selected instance. - * - * Identity and locating information of the selected DICOM SOP instances. - */ +The selected instance. + +Identity and locating information of the selected DICOM SOP instances. +*/ open class ImagingManifestStudySeriesInstance: BackboneElement { override open class var resourceType: String { get { return "ImagingManifestStudySeriesInstance" } diff --git a/Sources/Models/ImagingStudy.swift b/Sources/Models/ImagingStudy.swift index 983fc5b8..09295dd4 100644 --- a/Sources/Models/ImagingStudy.swift +++ b/Sources/Models/ImagingStudy.swift @@ -2,7 +2,7 @@ // ImagingStudy.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ImagingStudy) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ImagingStudy) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,13 +10,13 @@ import Foundation /** - * A set of images produced in single study (one or more series of references images). - * - * Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which - * includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a - * common context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple - * series of different modalities. - */ +A set of images produced in single study (one or more series of references images). + +Representation of the content produced in a DICOM imaging study. A study comprises a set of series, each of which +includes a set of Service-Object Pair Instances (SOP Instances - images or other data) acquired or produced in a common +context. A series is of only one modality (e.g. X-ray, CT, MR, ultrasound), but a study may have multiple series of +different modalities. +*/ open class ImagingStudy: DomainResource { override open class var resourceType: String { get { return "ImagingStudy" } @@ -390,10 +390,10 @@ open class ImagingStudy: DomainResource { /** - * Study access service endpoint. - * - * Methods of accessing (e.g., retrieving, viewing) the study. - */ +Study access service endpoint. + +Methods of accessing (e.g., retrieving, viewing) the study. +*/ open class ImagingStudyBaseLocation: BackboneElement { override open class var resourceType: String { get { return "ImagingStudyBaseLocation" } @@ -464,10 +464,10 @@ open class ImagingStudyBaseLocation: BackboneElement { /** - * Each study has one or more series of instances. - * - * Each study has one or more series of images or other content. - */ +Each study has one or more series of instances. + +Each study has one or more series of images or other content. +*/ open class ImagingStudySeries: BackboneElement { override open class var resourceType: String { get { return "ImagingStudySeries" } @@ -697,10 +697,10 @@ open class ImagingStudySeries: BackboneElement { /** - * Series access endpoint. - * - * Methods of accessing (e.g. retrieving) the series. - */ +Series access endpoint. + +Methods of accessing (e.g. retrieving) the series. +*/ open class ImagingStudySeriesBaseLocation: BackboneElement { override open class var resourceType: String { get { return "ImagingStudySeriesBaseLocation" } @@ -771,10 +771,10 @@ open class ImagingStudySeriesBaseLocation: BackboneElement { /** - * A single SOP instance from the series. - * - * A single SOP Instance within the series, e.g. an image, or presentation state. - */ +A single SOP instance from the series. + +A single SOP Instance within the series, e.g. an image, or presentation state. +*/ open class ImagingStudySeriesInstance: BackboneElement { override open class var resourceType: String { get { return "ImagingStudySeriesInstance" } diff --git a/Sources/Models/Immunization.swift b/Sources/Models/Immunization.swift index d89370e7..f4e46dd1 100644 --- a/Sources/Models/Immunization.swift +++ b/Sources/Models/Immunization.swift @@ -2,7 +2,7 @@ // Immunization.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Immunization) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Immunization) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,12 +10,11 @@ import Foundation /** - * Immunization event information. - * - * Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a - * patient, a clinician or another party and may include vaccine reaction information and what vaccination protocol was - * followed. - */ +Immunization event information. + +Describes the event of a patient being administered a vaccination or a record of a vaccination as reported by a patient, +a clinician or another party and may include vaccine reaction information and what vaccination protocol was followed. +*/ open class Immunization: DomainResource { override open class var resourceType: String { get { return "Immunization" } @@ -72,8 +71,9 @@ open class Immunization: DomainResource { /// Body site vaccine was administered. public var site: CodeableConcept? - /// in-progress | on-hold | completed | entered-in-error | stopped. - public var status: String? + /// Indicates the current status of the vaccination event. + /// Only use: ['completed', 'entered-in-error'] + public var status: MedicationAdministrationStatus? /// What protocol was followed. public var vaccinationProtocol: [ImmunizationVaccinationProtocol]? @@ -86,7 +86,7 @@ open class Immunization: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(patient: Reference, reported: Bool, status: String, vaccineCode: CodeableConcept, wasNotGiven: Bool) { + public convenience init(patient: Reference, reported: Bool, status: MedicationAdministrationStatus, vaccineCode: CodeableConcept, wasNotGiven: Bool) { self.init() self.patient = patient self.reported = reported @@ -325,7 +325,12 @@ open class Immunization: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = MedicationAdministrationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -435,7 +440,7 @@ open class Immunization: DomainResource { json["site"] = site.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let vaccinationProtocol = self.vaccinationProtocol { json["vaccinationProtocol"] = vaccinationProtocol.map() { $0.asJSON(errors: &errors) } @@ -453,10 +458,10 @@ open class Immunization: DomainResource { /** - * Administration/non-administration reasons. - * - * Reasons why a vaccine was or was not administered. - */ +Administration/non-administration reasons. + +Reasons why a vaccine was or was not administered. +*/ open class ImmunizationExplanation: BackboneElement { override open class var resourceType: String { get { return "ImmunizationExplanation" } @@ -518,10 +523,10 @@ open class ImmunizationExplanation: BackboneElement { /** - * Details of a reaction that follows immunization. - * - * Categorical data indicating that an adverse event is associated in time to an immunization. - */ +Details of a reaction that follows immunization. + +Categorical data indicating that an adverse event is associated in time to an immunization. +*/ open class ImmunizationReaction: BackboneElement { override open class var resourceType: String { get { return "ImmunizationReaction" } @@ -593,10 +598,10 @@ open class ImmunizationReaction: BackboneElement { /** - * What protocol was followed. - * - * Contains information about the protocol(s) under which the vaccine was administered. - */ +What protocol was followed. + +Contains information about the protocol(s) under which the vaccine was administered. +*/ open class ImmunizationVaccinationProtocol: BackboneElement { override open class var resourceType: String { get { return "ImmunizationVaccinationProtocol" } diff --git a/Sources/Models/ImmunizationRecommendation.swift b/Sources/Models/ImmunizationRecommendation.swift index 4d1af0e3..a6664529 100644 --- a/Sources/Models/ImmunizationRecommendation.swift +++ b/Sources/Models/ImmunizationRecommendation.swift @@ -2,7 +2,7 @@ // ImmunizationRecommendation.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ImmunizationRecommendation) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Guidance or advice relating to an immunization. - * - * A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility - * according to a published schedule) with optional supporting justification. - */ +Guidance or advice relating to an immunization. + +A patient's point-in-time immunization and recommendation (i.e. forecasting a patient's immunization eligibility +according to a published schedule) with optional supporting justification. +*/ open class ImmunizationRecommendation: DomainResource { override open class var resourceType: String { get { return "ImmunizationRecommendation" } @@ -110,8 +110,8 @@ open class ImmunizationRecommendation: DomainResource { /** - * Vaccine administration recommendations. - */ +Vaccine administration recommendations. +*/ open class ImmunizationRecommendationRecommendation: BackboneElement { override open class var resourceType: String { get { return "ImmunizationRecommendationRecommendation" } @@ -301,10 +301,10 @@ open class ImmunizationRecommendationRecommendation: BackboneElement { /** - * Dates governing proposed immunization. - * - * Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc. - */ +Dates governing proposed immunization. + +Vaccine date recommendations. For example, earliest date to administer, latest date to administer, etc. +*/ open class ImmunizationRecommendationRecommendationDateCriterion: BackboneElement { override open class var resourceType: String { get { return "ImmunizationRecommendationRecommendationDateCriterion" } @@ -375,10 +375,10 @@ open class ImmunizationRecommendationRecommendationDateCriterion: BackboneElemen /** - * Protocol used by recommendation. - * - * Contains information about the protocol under which the vaccine was administered. - */ +Protocol used by recommendation. + +Contains information about the protocol under which the vaccine was administered. +*/ open class ImmunizationRecommendationRecommendationProtocol: BackboneElement { override open class var resourceType: String { get { return "ImmunizationRecommendationRecommendationProtocol" } diff --git a/Sources/Models/ImplementationGuide.swift b/Sources/Models/ImplementationGuide.swift index 734f4f23..4807bbea 100644 --- a/Sources/Models/ImplementationGuide.swift +++ b/Sources/Models/ImplementationGuide.swift @@ -2,7 +2,7 @@ // ImplementationGuide.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ImplementationGuide) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ImplementationGuide) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * A set of rules about how FHIR is used. - * - * A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of - * an implementation guide into a logical whole, and to publish a computable definition of all the parts. - */ +A set of rules about how FHIR is used. + +A set of rules or how FHIR is used to solve a particular problem. This resource is used to gather all the parts of an +implementation guide into a logical whole, and to publish a computable definition of all the parts. +*/ open class ImplementationGuide: DomainResource { override open class var resourceType: String { get { return "ImplementationGuide" } @@ -62,8 +62,8 @@ open class ImplementationGuide: DomainResource { /// Name of the publisher (Organization or individual). public var publisher: String? - /// draft | active | retired. - public var status: String? + /// The status of this implementation guide. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Logical uri to reference this implementation guide (globally unique). public var url: URL? @@ -76,7 +76,7 @@ open class ImplementationGuide: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(name: String, status: String, url: URL) { + public convenience init(name: String, status: PublicationStatus, url: URL) { self.init() self.name = name self.status = status @@ -248,7 +248,12 @@ open class ImplementationGuide: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -299,11 +304,7 @@ open class ImplementationGuide: DomainResource { var json = super.asJSON(errors: &errors) if let binary = self.binary { - var arr = [Any]() - for val in binary { - arr.append(val.asJSON()) - } - json["binary"] = arr + json["binary"] = binary.map() { $0.asJSON() } } if let contact = self.contact { json["contact"] = contact.map() { $0.asJSON(errors: &errors) } @@ -345,7 +346,7 @@ open class ImplementationGuide: DomainResource { json["publisher"] = publisher.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let url = self.url { json["url"] = url.asJSON() @@ -363,25 +364,25 @@ open class ImplementationGuide: DomainResource { /** - * Another Implementation guide this depends on. - * - * Another implementation guide that this implementation depends on. Typically, an implementation guide uses value - * sets, profiles etc.defined in other implementation guides. - */ +Another Implementation guide this depends on. + +Another implementation guide that this implementation depends on. Typically, an implementation guide uses value sets, +profiles etc.defined in other implementation guides. +*/ open class ImplementationGuideDependency: BackboneElement { override open class var resourceType: String { get { return "ImplementationGuideDependency" } } - /// reference | inclusion. - public var type: String? + /// How the dependency is represented when the guide is published. + public var type: GuideDependencyType? /// Where to find dependency. public var uri: URL? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(type: String, uri: URL) { + public convenience init(type: GuideDependencyType, uri: URL) { self.init() self.type = type self.uri = uri @@ -393,7 +394,12 @@ open class ImplementationGuideDependency: BackboneElement { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = GuideDependencyType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -421,7 +427,7 @@ open class ImplementationGuideDependency: BackboneElement { var json = super.asJSON(errors: &errors) if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } if let uri = self.uri { json["uri"] = uri.asJSON() @@ -433,10 +439,10 @@ open class ImplementationGuideDependency: BackboneElement { /** - * Profiles that apply globally. - * - * A set of profiles that all resources covered by this implementation guide must conform to. - */ +Profiles that apply globally. + +A set of profiles that all resources covered by this implementation guide must conform to. +*/ open class ImplementationGuideGlobal: BackboneElement { override open class var resourceType: String { get { return "ImplementationGuideGlobal" } @@ -507,10 +513,10 @@ open class ImplementationGuideGlobal: BackboneElement { /** - * Group of resources as used in .page.package. - * - * A logical group of resources. Logical groups can be used when building pages. - */ +Group of resources as used in .page.package. + +A logical group of resources. Logical groups can be used when building pages. +*/ open class ImplementationGuidePackage: BackboneElement { override open class var resourceType: String { get { return "ImplementationGuidePackage" } @@ -596,12 +602,11 @@ open class ImplementationGuidePackage: BackboneElement { /** - * Resource in the implementation guide. - * - * A resource that is part of the implementation guide. Conformance resources (value set, structure definition, - * capability statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an - * example resource. - */ +Resource in the implementation guide. + +A resource that is part of the implementation guide. Conformance resources (value set, structure definition, capability +statements etc.) are obvious candidates for inclusion, but any kind of resource can be included as an example resource. +*/ open class ImplementationGuidePackageResource: BackboneElement { override open class var resourceType: String { get { return "ImplementationGuidePackageResource" } @@ -762,10 +767,10 @@ open class ImplementationGuidePackageResource: BackboneElement { /** - * Page/Section in the Guide. - * - * A page / section in the implementation guide. The root page is the implementation guide home page. - */ +Page/Section in the Guide. + +A page / section in the implementation guide. The root page is the implementation guide home page. +*/ open class ImplementationGuidePage: BackboneElement { override open class var resourceType: String { get { return "ImplementationGuidePage" } @@ -774,8 +779,9 @@ open class ImplementationGuidePage: BackboneElement { /// Format of the page (e.g. html, markdown, etc.). public var format: String? - /// page | example | list | include | directory | dictionary | toc | resource. - public var kind: String? + /// The kind of page that this is. Some pages are autogenerated (list, example), and other kinds are of interest so + /// that tools can navigate the user to the page of interest. + public var kind: GuidePageKind? /// Name of package to include. public var package: [String]? @@ -794,7 +800,7 @@ open class ImplementationGuidePage: BackboneElement { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(kind: String, source: URL, title: String) { + public convenience init(kind: GuidePageKind, source: URL, title: String) { self.init() self.kind = kind self.source = source @@ -816,7 +822,12 @@ open class ImplementationGuidePage: BackboneElement { if let exist = json["kind"] { presentKeys.insert("kind") if let val = exist as? String { - self.kind = val + if let enumval = GuidePageKind(rawValue: val) { + self.kind = enumval + } + else { + errors.append(FHIRValidationError(key: "kind", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "kind", wants: String.self, has: type(of: exist))) @@ -891,14 +902,10 @@ open class ImplementationGuidePage: BackboneElement { json["format"] = format.asJSON() } if let kind = self.kind { - json["kind"] = kind.asJSON() + json["kind"] = kind.rawValue } if let package = self.package { - var arr = [Any]() - for val in package { - arr.append(val.asJSON()) - } - json["package"] = arr + json["package"] = package.map() { $0.asJSON() } } if let page = self.page { json["page"] = page.map() { $0.asJSON(errors: &errors) } @@ -910,11 +917,7 @@ open class ImplementationGuidePage: BackboneElement { json["title"] = title.asJSON() } if let type = self.type { - var arr = [Any]() - for val in type { - arr.append(val.asJSON()) - } - json["type"] = arr + json["type"] = type.map() { $0.asJSON() } } return json diff --git a/Sources/Models/Library.swift b/Sources/Models/Library.swift index 4700e236..b92457c3 100644 --- a/Sources/Models/Library.swift +++ b/Sources/Models/Library.swift @@ -2,7 +2,7 @@ // Library.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Library) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Library) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,12 +10,12 @@ import Foundation /** - * Represents a library of quality improvement components. - * - * The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and - * expose exist knowledge assets such as logic libraries and information model descriptions, as well as to describe a - * collection of knowledge assets. - */ +Represents a library of quality improvement components. + +The Library resource is a general-purpose container for knowledge asset definitions. It can be used to describe and +expose exist knowledge assets such as logic libraries and information model descriptions, as well as to describe a +collection of knowledge assets. +*/ open class Library: DomainResource { override open class var resourceType: String { get { return "Library" } @@ -75,8 +75,8 @@ open class Library: DomainResource { /// Related artifacts for the library. public var relatedArtifact: [RelatedArtifact]? - /// draft | active | retired. - public var status: String? + /// The status of this library. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Name for this library (Human friendly). public var title: String? @@ -101,7 +101,7 @@ open class Library: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(content: Attachment, status: String, type: CodeableConcept) { + public convenience init(content: Attachment, status: PublicationStatus, type: CodeableConcept) { self.init() self.content = content self.status = status @@ -324,7 +324,12 @@ open class Library: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -475,7 +480,7 @@ open class Library: DomainResource { json["relatedArtifact"] = relatedArtifact.map() { $0.asJSON(errors: &errors) } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let title = self.title { json["title"] = title.asJSON() diff --git a/Sources/Models/Linkage.swift b/Sources/Models/Linkage.swift index 046f9e7c..6ad8f9c2 100644 --- a/Sources/Models/Linkage.swift +++ b/Sources/Models/Linkage.swift @@ -2,7 +2,7 @@ // Linkage.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Linkage) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Linkage) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Links records for 'same' item. - * - * Identifies two or more records (resource instances) that are referring to the same real-world "occurrence". - */ +Links records for 'same' item. + +Identifies two or more records (resource instances) that are referring to the same real-world "occurrence". +*/ open class Linkage: DomainResource { override open class var resourceType: String { get { return "Linkage" } @@ -85,11 +85,11 @@ open class Linkage: DomainResource { /** - * Item to be linked. - * - * Identifies one of the records that is considered to refer to the same real-world occurrence as well as how the items - * hould be evaluated within the collection of linked items. - */ +Item to be linked. + +Identifies one of the records that is considered to refer to the same real-world occurrence as well as how the items +hould be evaluated within the collection of linked items. +*/ open class LinkageItem: BackboneElement { override open class var resourceType: String { get { return "LinkageItem" } @@ -98,12 +98,13 @@ open class LinkageItem: BackboneElement { /// Resource being linked. public var resource: Reference? - /// source | alternate | historical. - public var type: String? + /// Distinguishes which item is "source of truth" (if any) and which items are no longer considered to be current + /// representations. + public var type: LinkageType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(resource: Reference, type: String) { + public convenience init(resource: Reference, type: LinkageType) { self.init() self.resource = resource self.type = type @@ -132,7 +133,12 @@ open class LinkageItem: BackboneElement { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = LinkageType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -151,7 +157,7 @@ open class LinkageItem: BackboneElement { json["resource"] = resource.asJSON(errors: &errors) } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json diff --git a/Sources/Models/List.swift b/Sources/Models/List.swift index 115312da..656b26c1 100644 --- a/Sources/Models/List.swift +++ b/Sources/Models/List.swift @@ -2,7 +2,7 @@ // List.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/List) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/List) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Information summarized from a list of other resources. - * - * A set of information summarized from a list of other resources. - */ +Information summarized from a list of other resources. + +A set of information summarized from a list of other resources. +*/ open class List: DomainResource { override open class var resourceType: String { get { return "List" } @@ -37,8 +37,10 @@ open class List: DomainResource { /// Business identifier. public var identifier: [Identifier]? - /// working | snapshot | changes. - public var mode: String? + /// How this list was prepared - whether it is a working list that is suitable for being maintained on an ongoing + /// basis, or if it represents a snapshot of a list of items from another source, or whether it is a prepared list + /// where items may be marked as added, modified or deleted. + public var mode: ListMode? /// Comments about the list. public var note: [Annotation]? @@ -49,8 +51,8 @@ open class List: DomainResource { /// Who and/or what defined the list contents (aka Author). public var source: Reference? - /// current | retired | entered-in-error. - public var status: String? + /// Indicates the current state of this list. + public var status: ListStatus? /// If all resources have the same subject. public var subject: Reference? @@ -60,7 +62,7 @@ open class List: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(mode: String, status: String) { + public convenience init(mode: ListMode, status: ListStatus) { self.init() self.mode = mode self.status = status @@ -151,7 +153,12 @@ open class List: DomainResource { if let exist = json["mode"] { presentKeys.insert("mode") if let val = exist as? String { - self.mode = val + if let enumval = ListMode(rawValue: val) { + self.mode = enumval + } + else { + errors.append(FHIRValidationError(key: "mode", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "mode", wants: String.self, has: type(of: exist))) @@ -205,7 +212,12 @@ open class List: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = ListStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -262,7 +274,7 @@ open class List: DomainResource { json["identifier"] = identifier.map() { $0.asJSON(errors: &errors) } } if let mode = self.mode { - json["mode"] = mode.asJSON() + json["mode"] = mode.rawValue } if let note = self.note { json["note"] = note.map() { $0.asJSON(errors: &errors) } @@ -274,7 +286,7 @@ open class List: DomainResource { json["source"] = source.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) @@ -289,10 +301,10 @@ open class List: DomainResource { /** - * Entries in the list. - * - * Entries in this list. - */ +Entries in the list. + +Entries in this list. +*/ open class ListEntry: BackboneElement { override open class var resourceType: String { get { return "ListEntry" } diff --git a/Sources/Models/Location.swift b/Sources/Models/Location.swift index 753474fd..757ee76d 100644 --- a/Sources/Models/Location.swift +++ b/Sources/Models/Location.swift @@ -2,7 +2,7 @@ // Location.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Location) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Location) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Details and position information for a physical place. - * - * Details and position information for a physical place where services are provided and resources and participants - * may be stored, found, contained or accommodated. - */ +Details and position information for a physical place. + +Details and position information for a physical place where services are provided and resources and participants may be +stored, found, contained or accommodated. +*/ open class Location: DomainResource { override open class var resourceType: String { get { return "Location" } @@ -26,7 +26,8 @@ open class Location: DomainResource { /// A list of alternate names that the location is known as, or was known as in the past. public var alias: [String]? - /// Additional details about the location that could be displayed as further information to identify the location beyond its name. + /// Additional details about the location that could be displayed as further information to identify the location + /// beyond its name. public var description_fhir: String? /// Technical endpoints providing access to services operated for the location. @@ -38,8 +39,8 @@ open class Location: DomainResource { /// Organization responsible for provisioning and upkeep. public var managingOrganization: Reference? - /// instance | kind. - public var mode: String? + /// Indicates whether a resource instance represents a specific location or a class of locations. + public var mode: LocationMode? /// Name of the location as used by humans. public var name: String? @@ -53,8 +54,8 @@ open class Location: DomainResource { /// The absolute geographic location. public var position: LocationPosition? - /// active | suspended | inactive. - public var status: String? + /// None + public var status: LocationStatus? /// Contact details of the location. public var telecom: [ContactPoint]? @@ -142,7 +143,12 @@ open class Location: DomainResource { if let exist = json["mode"] { presentKeys.insert("mode") if let val = exist as? String { - self.mode = val + if let enumval = LocationMode(rawValue: val) { + self.mode = enumval + } + else { + errors.append(FHIRValidationError(key: "mode", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "mode", wants: String.self, has: type(of: exist))) @@ -202,7 +208,12 @@ open class Location: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = LocationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -246,11 +257,7 @@ open class Location: DomainResource { json["address"] = address.asJSON(errors: &errors) } if let alias = self.alias { - var arr = [Any]() - for val in alias { - arr.append(val.asJSON()) - } - json["alias"] = arr + json["alias"] = alias.map() { $0.asJSON() } } if let description_fhir = self.description_fhir { json["description"] = description_fhir.asJSON() @@ -265,7 +272,7 @@ open class Location: DomainResource { json["managingOrganization"] = managingOrganization.asJSON(errors: &errors) } if let mode = self.mode { - json["mode"] = mode.asJSON() + json["mode"] = mode.rawValue } if let name = self.name { json["name"] = name.asJSON() @@ -280,7 +287,7 @@ open class Location: DomainResource { json["position"] = position.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let telecom = self.telecom { json["telecom"] = telecom.map() { $0.asJSON(errors: &errors) } @@ -295,11 +302,11 @@ open class Location: DomainResource { /** - * The absolute geographic location. - * - * The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate - * system used in KML). - */ +The absolute geographic location. + +The absolute geographic location of the Location, expressed using the WGS84 datum (This is the same co-ordinate system +used in KML). +*/ open class LocationPosition: BackboneElement { override open class var resourceType: String { get { return "LocationPosition" } diff --git a/Sources/Models/Measure.swift b/Sources/Models/Measure.swift index fbf1a5a5..59fd0d6a 100644 --- a/Sources/Models/Measure.swift +++ b/Sources/Models/Measure.swift @@ -2,7 +2,7 @@ // Measure.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Measure) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Measure) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * A quality measure definition. - * - * The Measure resource provides the definition of a quality measure. - */ +A quality measure definition. + +The Measure resource provides the definition of a quality measure. +*/ open class Measure: DomainResource { override open class var resourceType: String { get { return "Measure" } @@ -94,14 +94,14 @@ open class Measure: DomainResource { /// How is risk adjustment applied for this measure. public var riskAdjustment: String? - /// proportion | ratio | continuous-variable | cohort. - public var scoring: String? + /// The measure scoring type, e.g. proportion, CV. + public var scoring: MeasureScoring? /// The measure set, e.g. Preventive Care and Screening. public var set: String? - /// draft | active | retired. - public var status: String? + /// The status of this measure. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Supplemental data. public var supplementalData: [MeasureSupplementalData]? @@ -112,8 +112,8 @@ open class Measure: DomainResource { /// Descriptional topics for the measure. public var topic: [CodeableConcept]? - /// process | outcome. - public var type: [String]? + /// The measure type, e.g. process, outcome. + public var type: [MeasureType]? /// Logical uri to reference this measure (globally unique). public var url: URL? @@ -129,7 +129,7 @@ open class Measure: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: PublicationStatus) { self.init() self.status = status } @@ -405,7 +405,12 @@ open class Measure: DomainResource { if let exist = json["scoring"] { presentKeys.insert("scoring") if let val = exist as? String { - self.scoring = val + if let enumval = MeasureScoring(rawValue: val) { + self.scoring = enumval + } + else { + errors.append(FHIRValidationError(key: "scoring", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "scoring", wants: String.self, has: type(of: exist))) @@ -423,7 +428,12 @@ open class Measure: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -471,8 +481,12 @@ open class Measure: DomainResource { } if let exist = json["type"] { presentKeys.insert("type") - if let val = exist as? [String] { - self.type = val + if let val = exist as? [String] { var i = -1 + self.type = val.map() { i += 1 + if let enumval = MeasureType(rawValue: $0) { return enumval } + errors.append(FHIRValidationError(key: "type.\(i)", problem: "the value “\(val)” is not valid")) + return nil + }.filter() { nil != $0 }.map() { $0! } } else { errors.append(FHIRValidationError(key: "type", wants: Array.self, has: type(of: exist))) @@ -601,13 +615,13 @@ open class Measure: DomainResource { json["riskAdjustment"] = riskAdjustment.asJSON() } if let scoring = self.scoring { - json["scoring"] = scoring.asJSON() + json["scoring"] = scoring.rawValue } if let set = self.set { json["set"] = set.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let supplementalData = self.supplementalData { json["supplementalData"] = supplementalData.map() { $0.asJSON(errors: &errors) } @@ -619,11 +633,7 @@ open class Measure: DomainResource { json["topic"] = topic.map() { $0.asJSON(errors: &errors) } } if let type = self.type { - var arr = [Any]() - for val in type { - arr.append(val.asJSON()) - } - json["type"] = arr + json["type"] = type.map() { $0.rawValue } } if let url = self.url { json["url"] = url.asJSON() @@ -644,10 +654,10 @@ open class Measure: DomainResource { /** - * Population criteria group. - * - * A group of population criteria for the measure. - */ +Population criteria group. + +A group of population criteria for the measure. +*/ open class MeasureGroup: BackboneElement { override open class var resourceType: String { get { return "MeasureGroup" } @@ -769,10 +779,10 @@ open class MeasureGroup: BackboneElement { /** - * Population criteria. - * - * A population criteria for the measure. - */ +Population criteria. + +A population criteria for the measure. +*/ open class MeasureGroupPopulation: BackboneElement { override open class var resourceType: String { get { return "MeasureGroupPopulation" } @@ -790,12 +800,12 @@ open class MeasureGroupPopulation: BackboneElement { /// Short name. public var name: String? - /// initial-population | numerator | numerator-exclusion | denominator | denominator-exclusion | denominator-exception | measure-population | measure-population-exclusion | measure-observation. - public var type: String? + /// The type of population criteria. + public var type: MeasurePopulationType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(criteria: String, identifier: Identifier, type: String) { + public convenience init(criteria: String, identifier: Identifier, type: MeasurePopulationType) { self.init() self.criteria = criteria self.identifier = identifier @@ -855,7 +865,12 @@ open class MeasureGroupPopulation: BackboneElement { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = MeasurePopulationType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -883,7 +898,7 @@ open class MeasureGroupPopulation: BackboneElement { json["name"] = name.asJSON() } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json @@ -892,11 +907,11 @@ open class MeasureGroupPopulation: BackboneElement { /** - * Stratifier criteria for the measure. - * - * The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined - * within a referenced library, or a valid FHIR Resource Path. - */ +Stratifier criteria for the measure. + +The stratifier criteria for the measure report, specified as either the name of a valid CQL expression defined within a +referenced library, or a valid FHIR Resource Path. +*/ open class MeasureGroupStratifier: BackboneElement { override open class var resourceType: String { get { return "MeasureGroupStratifier" } @@ -978,11 +993,11 @@ open class MeasureGroupStratifier: BackboneElement { /** - * Supplemental data. - * - * The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within - * a referenced library, or a valid FHIR Resource Path. - */ +Supplemental data. + +The supplemental data criteria for the measure report, specified as either the name of a valid CQL expression within a +referenced library, or a valid FHIR Resource Path. +*/ open class MeasureSupplementalData: BackboneElement { override open class var resourceType: String { get { return "MeasureSupplementalData" } @@ -997,8 +1012,11 @@ open class MeasureSupplementalData: BackboneElement { /// Path to the supplemental data element. public var path: String? - /// supplemental-data | risk-adjustment-factor. - public var usage: [String]? + /// An indicator of the intended usage for the supplemental data element. Supplemental data indicates the data is + /// additional information requested to augment the measure information. Risk adjustment factor indicates the data + /// is additional information used to calculate risk adjustment factors when applying a risk model to the measure + /// calculation. + public var usage: [MeasureDataUsage]? /** Convenience initializer, taking all required properties as arguments. */ @@ -1047,8 +1065,12 @@ open class MeasureSupplementalData: BackboneElement { } if let exist = json["usage"] { presentKeys.insert("usage") - if let val = exist as? [String] { - self.usage = val + if let val = exist as? [String] { var i = -1 + self.usage = val.map() { i += 1 + if let enumval = MeasureDataUsage(rawValue: $0) { return enumval } + errors.append(FHIRValidationError(key: "usage.\(i)", problem: "the value “\(val)” is not valid")) + return nil + }.filter() { nil != $0 }.map() { $0! } } else { errors.append(FHIRValidationError(key: "usage", wants: Array.self, has: type(of: exist))) @@ -1070,11 +1092,7 @@ open class MeasureSupplementalData: BackboneElement { json["path"] = path.asJSON() } if let usage = self.usage { - var arr = [Any]() - for val in usage { - arr.append(val.asJSON()) - } - json["usage"] = arr + json["usage"] = usage.map() { $0.rawValue } } return json diff --git a/Sources/Models/MeasureReport.swift b/Sources/Models/MeasureReport.swift index d53904e6..8fc6bafa 100644 --- a/Sources/Models/MeasureReport.swift +++ b/Sources/Models/MeasureReport.swift @@ -2,7 +2,7 @@ // MeasureReport.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/MeasureReport) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/MeasureReport) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Results of a measure evaluation. - * - * The MeasureReport resource contains the results of evaluating a measure. - */ +Results of a measure evaluation. + +The MeasureReport resource contains the results of evaluating a measure. +*/ open class MeasureReport: DomainResource { override open class var resourceType: String { get { return "MeasureReport" } @@ -40,15 +40,17 @@ open class MeasureReport: DomainResource { /// Reporting Organization. public var reportingOrganization: Reference? - /// complete | pending | error. - public var status: String? + /// The report status. No data will be available until the report status is complete. + public var status: MeasureReportStatus? - /// individual | patient-list | summary. - public var type: String? + /// The type of measure report. This may be an individual report, which provides a single patient's score for the + /// measure, a patient listing, which returns the list of patients that meet the various criteria in the measure, or + /// a summary report, which returns a population count for each criteria in the measure. + public var type: MeasureReportType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(measure: Reference, period: Period, status: String, type: String) { + public convenience init(measure: Reference, period: Period, status: MeasureReportStatus, type: MeasureReportType) { self.init() self.measure = measure self.period = period @@ -161,7 +163,12 @@ open class MeasureReport: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = MeasureReportStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -173,7 +180,12 @@ open class MeasureReport: DomainResource { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = MeasureReportType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -210,10 +222,10 @@ open class MeasureReport: DomainResource { json["reportingOrganization"] = reportingOrganization.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json @@ -222,10 +234,10 @@ open class MeasureReport: DomainResource { /** - * Measure results for each group. - * - * The results of the calculation, one for each population group in the measure. - */ +Measure results for each group. + +The results of the calculation, one for each population group in the measure. +*/ open class MeasureReportGroup: BackboneElement { override open class var resourceType: String { get { return "MeasureReportGroup" } @@ -352,10 +364,10 @@ open class MeasureReportGroup: BackboneElement { /** - * The populations in the group. - * - * The populations that make up the population group, one for each type of population appropriate for the measure. - */ +The populations in the group. + +The populations that make up the population group, one for each type of population appropriate for the measure. +*/ open class MeasureReportGroupPopulation: BackboneElement { override open class var resourceType: String { get { return "MeasureReportGroupPopulation" } @@ -367,12 +379,12 @@ open class MeasureReportGroupPopulation: BackboneElement { /// For patient-list reports, the patients in this population. public var patients: Reference? - /// initial-population | numerator | numerator-exclusion | denominator | denominator-exclusion | denominator-exception | measure-population | measure-population-exclusion | measure-score. - public var type: String? + /// The type of the population. + public var type: MeasurePopulationType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(type: String) { + public convenience init(type: MeasurePopulationType) { self.init() self.type = type } @@ -406,7 +418,12 @@ open class MeasureReportGroupPopulation: BackboneElement { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = MeasurePopulationType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -428,7 +445,7 @@ open class MeasureReportGroupPopulation: BackboneElement { json["patients"] = patients.asJSON(errors: &errors) } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json @@ -437,11 +454,11 @@ open class MeasureReportGroupPopulation: BackboneElement { /** - * Stratification results. - * - * When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the - * measure. - */ +Stratification results. + +When a measure includes multiple stratifiers, there will be a stratifier group for each stratifier defined by the +measure. +*/ open class MeasureReportGroupStratifier: BackboneElement { override open class var resourceType: String { get { return "MeasureReportGroupStratifier" } @@ -513,11 +530,11 @@ open class MeasureReportGroupStratifier: BackboneElement { /** - * Stratum results, one for each unique value in the stratifier. - * - * This element contains the results for a single stratum within the stratifier. For example, when stratifying on - * administrative gender, there will be four strata, one for each possible gender value. - */ +Stratum results, one for each unique value in the stratifier. + +This element contains the results for a single stratum within the stratifier. For example, when stratifying on +administrative gender, there will be four strata, one for each possible gender value. +*/ open class MeasureReportGroupStratifierGroup: BackboneElement { override open class var resourceType: String { get { return "MeasureReportGroupStratifierGroup" } @@ -599,10 +616,10 @@ open class MeasureReportGroupStratifierGroup: BackboneElement { /** - * Population results in this stratum. - * - * The populations that make up the stratum, one for each type of population appropriate to the measure. - */ +Population results in this stratum. + +The populations that make up the stratum, one for each type of population appropriate to the measure. +*/ open class MeasureReportGroupStratifierGroupPopulation: BackboneElement { override open class var resourceType: String { get { return "MeasureReportGroupStratifierGroupPopulation" } @@ -614,12 +631,12 @@ open class MeasureReportGroupStratifierGroupPopulation: BackboneElement { /// For patient-list reports, the patients in this population. public var patients: Reference? - /// initial-population | numerator | numerator-exclusion | denominator | denominator-exclusion | denominator-exception | measure-population | measure-population-exclusion | measure-score. - public var type: String? + /// The type of the population. + public var type: MeasurePopulationType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(type: String) { + public convenience init(type: MeasurePopulationType) { self.init() self.type = type } @@ -653,7 +670,12 @@ open class MeasureReportGroupStratifierGroupPopulation: BackboneElement { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = MeasurePopulationType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -675,7 +697,7 @@ open class MeasureReportGroupStratifierGroupPopulation: BackboneElement { json["patients"] = patients.asJSON(errors: &errors) } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json @@ -684,11 +706,11 @@ open class MeasureReportGroupStratifierGroupPopulation: BackboneElement { /** - * Supplemental data elements for the measure. - * - * Supplemental data elements for the measure provide additional information requested by the measure for each patient - * involved in the populations. - */ +Supplemental data elements for the measure. + +Supplemental data elements for the measure provide additional information requested by the measure for each patient +involved in the populations. +*/ open class MeasureReportGroupSupplementalData: BackboneElement { override open class var resourceType: String { get { return "MeasureReportGroupSupplementalData" } @@ -760,11 +782,11 @@ open class MeasureReportGroupSupplementalData: BackboneElement { /** - * Supplemental data results, one for each unique supplemental data value. - * - * This element contains the results for a single value within the supplemental data. For example, when reporting - * supplemental data for administrative gender, there will be four groups, one for each possible gender value. - */ +Supplemental data results, one for each unique supplemental data value. + +This element contains the results for a single value within the supplemental data. For example, when reporting +supplemental data for administrative gender, there will be four groups, one for each possible gender value. +*/ open class MeasureReportGroupSupplementalDataGroup: BackboneElement { override open class var resourceType: String { get { return "MeasureReportGroupSupplementalDataGroup" } diff --git a/Sources/Models/Media.swift b/Sources/Models/Media.swift index 159a57a6..efae568e 100644 --- a/Sources/Models/Media.swift +++ b/Sources/Models/Media.swift @@ -2,7 +2,7 @@ // Media.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Media) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Media) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,9 +10,9 @@ import Foundation /** - * A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by - * direct reference. - */ +A photo, video, or audio recording acquired or used in healthcare. The actual content may be inline or provided by +direct reference. +*/ open class Media: DomainResource { override open class var resourceType: String { get { return "Media" } @@ -45,8 +45,8 @@ open class Media: DomainResource { /// The type of acquisition equipment/process. public var subtype: CodeableConcept? - /// photo | video | audio. - public var type: String? + /// Whether the media is a photo (still image), an audio recording, or a video recording. + public var type: DigitalMediaType? /// Imaging view, e.g. Lateral or Antero-posterior. public var view: CodeableConcept? @@ -56,7 +56,7 @@ open class Media: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(content: Attachment, type: String) { + public convenience init(content: Attachment, type: DigitalMediaType) { self.init() self.content = content self.type = type @@ -177,7 +177,12 @@ open class Media: DomainResource { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = DigitalMediaType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -243,7 +248,7 @@ open class Media: DomainResource { json["subtype"] = subtype.asJSON(errors: &errors) } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } if let view = self.view { json["view"] = view.asJSON(errors: &errors) diff --git a/Sources/Models/Medication.swift b/Sources/Models/Medication.swift index 183cc355..0db2d5f8 100644 --- a/Sources/Models/Medication.swift +++ b/Sources/Models/Medication.swift @@ -2,7 +2,7 @@ // Medication.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Medication) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Medication) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Definition of a Medication. - * - * This resource is primarily used for the identification and definition of a medication. It covers the ingredients and - * the packaging for a medication. - */ +Definition of a Medication. + +This resource is primarily used for the identification and definition of a medication. It covers the ingredients and the +packaging for a medication. +*/ open class Medication: DomainResource { override open class var resourceType: String { get { return "Medication" } @@ -131,10 +131,10 @@ open class Medication: DomainResource { /** - * Details about packaged medications. - * - * Information that only applies to packages (not products). - */ +Details about packaged medications. + +Information that only applies to packages (not products). +*/ open class MedicationPackage: BackboneElement { override open class var resourceType: String { get { return "MedicationPackage" } @@ -196,10 +196,10 @@ open class MedicationPackage: BackboneElement { /** - * What is in the package. - * - * A set of components that go to make up the described item. - */ +What is in the package. + +A set of components that go to make up the described item. +*/ open class MedicationPackageContent: BackboneElement { override open class var resourceType: String { get { return "MedicationPackageContent" } @@ -301,10 +301,10 @@ open class MedicationPackageContent: BackboneElement { /** - * Administrable medication details. - * - * Information that only applies to products (not packages). - */ +Administrable medication details. + +Information that only applies to products (not packages). +*/ open class MedicationProduct: BackboneElement { override open class var resourceType: String { get { return "MedicationProduct" } @@ -386,10 +386,10 @@ open class MedicationProduct: BackboneElement { /** - * Identifies a single production run. - * - * Information about a group of medication produced or packaged from one production run. - */ +Identifies a single production run. + +Information about a group of medication produced or packaged from one production run. +*/ open class MedicationProductBatch: BackboneElement { override open class var resourceType: String { get { return "MedicationProductBatch" } @@ -441,10 +441,10 @@ open class MedicationProductBatch: BackboneElement { /** - * Active or inactive ingredient. - * - * Identifies a particular constituent of interest in the product. - */ +Active or inactive ingredient. + +Identifies a particular constituent of interest in the product. +*/ open class MedicationProductIngredient: BackboneElement { override open class var resourceType: String { get { return "MedicationProductIngredient" } diff --git a/Sources/Models/MedicationAdministration.swift b/Sources/Models/MedicationAdministration.swift index 26d9a44b..3fab2a88 100644 --- a/Sources/Models/MedicationAdministration.swift +++ b/Sources/Models/MedicationAdministration.swift @@ -2,7 +2,7 @@ // MedicationAdministration.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/MedicationAdministration) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/MedicationAdministration) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,12 +10,12 @@ import Foundation /** - * Administration of medication to a patient. - * - * Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as - * swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing - * prescription, and the specific encounter between patient and health care practitioner. - */ +Administration of medication to a patient. + +Describes the event of a patient consuming or otherwise being administered a medication. This may be as simple as +swallowing a tablet or it may be a long running infusion. Related resources tie this event to the authorizing +prescription, and the specific encounter between patient and health care practitioner. +*/ open class MedicationAdministration: DomainResource { override open class var resourceType: String { get { return "MedicationAdministration" } @@ -72,15 +72,17 @@ open class MedicationAdministration: DomainResource { /// Condition or Observation that supports why the medication was administered. public var reasonReference: [Reference]? - /// in-progress | on-hold | completed | entered-in-error | stopped. - public var status: String? + /// Will generally be set to show that the administration has been completed. For some long running administrations + /// such as infusions it is possible for an administration to be started but not completed or it may be paused while + /// some other process is under way. + public var status: MedicationAdministrationStatus? /// Additional information to support administration. public var supportingInformation: [Reference]? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(effectiveTime: Any, medication: Any, patient: Reference, status: String) { + public convenience init(effectiveTime: Any, medication: Any, patient: Reference, status: MedicationAdministrationStatus) { self.init() if let value = effectiveTime as? DateTime { self.effectiveTimeDateTime = value @@ -341,7 +343,12 @@ open class MedicationAdministration: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = MedicationAdministrationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -430,7 +437,7 @@ open class MedicationAdministration: DomainResource { json["reasonReference"] = reasonReference.map() { $0.asJSON(errors: &errors) } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let supportingInformation = self.supportingInformation { json["supportingInformation"] = supportingInformation.map() { $0.asJSON(errors: &errors) } @@ -442,10 +449,10 @@ open class MedicationAdministration: DomainResource { /** - * Details of how medication was taken. - * - * Describes the medication dosage information details e.g. dose, rate, site, route, etc. - */ +Details of how medication was taken. + +Describes the medication dosage information details e.g. dose, rate, site, route, etc. +*/ open class MedicationAdministrationDosage: BackboneElement { override open class var resourceType: String { get { return "MedicationAdministrationDosage" } diff --git a/Sources/Models/MedicationDispense.swift b/Sources/Models/MedicationDispense.swift index 3664db9f..6f9a83ae 100644 --- a/Sources/Models/MedicationDispense.swift +++ b/Sources/Models/MedicationDispense.swift @@ -2,7 +2,7 @@ // MedicationDispense.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/MedicationDispense) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/MedicationDispense) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,12 +10,12 @@ import Foundation /** - * Dispensing a medication to a named patient. - * - * Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a - * description of the medication product (supply) provided and the instructions for administering the medication. The - * medication dispense is the result of a pharmacy system responding to a medication order. - */ +Dispensing a medication to a named patient. + +Indicates that a medication product is to be or has been dispensed for a named person/patient. This includes a +description of the medication product (supply) provided and the instructions for administering the medication. The +medication dispense is the result of a pharmacy system responding to a medication order. +*/ open class MedicationDispense: DomainResource { override open class var resourceType: String { get { return "MedicationDispense" } @@ -63,8 +63,8 @@ open class MedicationDispense: DomainResource { /// Who collected the medication. public var receiver: [Reference]? - /// in-progress | on-hold | completed | entered-in-error | stopped. - public var status: String? + /// A code specifying the state of the set of dispense events. + public var status: MedicationDispenseStatus? /// Deals with substitution of one medicine for another. public var substitution: MedicationDispenseSubstitution? @@ -298,7 +298,12 @@ open class MedicationDispense: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = MedicationDispenseStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -418,7 +423,7 @@ open class MedicationDispense: DomainResource { json["receiver"] = receiver.map() { $0.asJSON(errors: &errors) } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let substitution = self.substitution { json["substitution"] = substitution.asJSON(errors: &errors) @@ -442,12 +447,12 @@ open class MedicationDispense: DomainResource { /** - * Deals with substitution of one medicine for another. - * - * Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected - * but does not happen, in other cases substitution is not expected but does happen. This block explains what - * substitution did or did not happen and why. - */ +Deals with substitution of one medicine for another. + +Indicates whether or not substitution was made as part of the dispense. In some cases substitution will be expected but +does not happen, in other cases substitution is not expected but does happen. This block explains what substitution did +or did not happen and why. +*/ open class MedicationDispenseSubstitution: BackboneElement { override open class var resourceType: String { get { return "MedicationDispenseSubstitution" } diff --git a/Sources/Models/MedicationRequest.swift b/Sources/Models/MedicationRequest.swift index 1ddf9590..7914281e 100644 --- a/Sources/Models/MedicationRequest.swift +++ b/Sources/Models/MedicationRequest.swift @@ -2,7 +2,7 @@ // MedicationRequest.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/MedicationRequest) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/MedicationRequest) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,13 +10,12 @@ import Foundation /** - * Prescription of medication to for patient. - * - * An order for both supply of the medication and the instructions for administration of the medication to a patient. - * The resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize - * the use across inpatient and outpatient settings as well as for care plans, etc and to harmonize with workflow - * patterns. - */ +Prescription of medication to for patient. + +An order for both supply of the medication and the instructions for administration of the medication to a patient. The +resource is called "MedicationRequest" rather than "MedicationPrescription" or "MedicationOrder" to generalize the use +across inpatient and outpatient settings as well as for care plans, etc and to harmonize with workflow patterns. +*/ open class MedicationRequest: DomainResource { override open class var resourceType: String { get { return "MedicationRequest" } @@ -79,8 +78,8 @@ open class MedicationRequest: DomainResource { /// proposal | plan | original-order. public var stage: CodeableConcept? - /// active | on-hold | cancelled | completed | entered-in-error | stopped | draft. - public var status: String? + /// A code specifying the state of the order. Generally this will be active or completed state. + public var status: MedicationRequestStatus? /// Any restrictions on medication substitution. public var substitution: MedicationRequestSubstitution? @@ -378,7 +377,12 @@ open class MedicationRequest: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = MedicationRequestStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -481,7 +485,7 @@ open class MedicationRequest: DomainResource { json["stage"] = stage.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let substitution = self.substitution { json["substitution"] = substitution.asJSON(errors: &errors) @@ -496,13 +500,12 @@ open class MedicationRequest: DomainResource { /** - * Medication supply authorization. - * - * Indicates the specific details for the dispense or medication supply part of a medication order (also known as a - * Medication Prescription). Note that this information is NOT always sent with the order. There may be in some - * settings (e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy - * department. - */ +Medication supply authorization. + +Indicates the specific details for the dispense or medication supply part of a medication order (also known as a +Medication Prescription). Note that this information is NOT always sent with the order. There may be in some settings +(e.g. hospitals) institutional or system support for completing the dispense details in the pharmacy department. +*/ open class MedicationRequestDispenseRequest: BackboneElement { override open class var resourceType: String { get { return "MedicationRequestDispenseRequest" } @@ -619,12 +622,12 @@ open class MedicationRequestDispenseRequest: BackboneElement { /** - * Any restrictions on medication substitution. - * - * Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, - * in other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's - * intent. If nothing is specified substitution may be done. - */ +Any restrictions on medication substitution. + +Indicates whether or not substitution can or should be part of the dispense. In some cases substitution must happen, in +other cases substitution must not happen, and in others it does not matter. This block explains the prescriber's intent. +If nothing is specified substitution may be done. +*/ open class MedicationRequestSubstitution: BackboneElement { override open class var resourceType: String { get { return "MedicationRequestSubstitution" } diff --git a/Sources/Models/MedicationStatement.swift b/Sources/Models/MedicationStatement.swift index e9e94d6f..6acf302d 100644 --- a/Sources/Models/MedicationStatement.swift +++ b/Sources/Models/MedicationStatement.swift @@ -2,7 +2,7 @@ // MedicationStatement.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/MedicationStatement) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/MedicationStatement) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,23 +10,24 @@ import Foundation /** - * Record of medication being taken by a patient. - * - * A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient - * may be taking the medication now, or has taken the medication in the past or will be taking the medication in the - * future. The source of this information can be the patient, significant other (such as a family member or spouse), - * or a clinician. A common scenario where this information is captured is during the history taking process during a - * patient visit or stay. The medication information may come from e.g. the patient's memory, from a prescription - * bottle, or from a list of medications the patient, clinician or other party maintains The primary difference - * between a medication statement and a medication administration is that the medication administration has complete - * administration information and is based on actual administration information from the person who administered the - * medication. A medication statement is often, if not always, less specific. There is no required date/time when the - * medication was administered, in fact we only know that a source has reported the patient is taking this medication, - * where details such as time, quantity, or rate or even medication product may be incomplete or missing or less - * precise. As stated earlier, the medication statement information may come from the patient's memory, from a - * prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication - * administration is more formal and is not missing detailed information. - */ +Record of medication being taken by a patient. + +A record of a medication that is being consumed by a patient. A MedicationStatement may indicate that the patient may +be taking the medication now, or has taken the medication in the past or will be taking the medication in the future. +The source of this information can be the patient, significant other (such as a family member or spouse), or a +clinician. A common scenario where this information is captured is during the history taking process during a patient +visit or stay. The medication information may come from e.g. the patient's memory, from a prescription bottle, or +from a list of medications the patient, clinician or other party maintains + +The primary difference between a medication statement and a medication administration is that the medication +administration has complete administration information and is based on actual administration information from the person +who administered the medication. A medication statement is often, if not always, less specific. There is no required +date/time when the medication was administered, in fact we only know that a source has reported the patient is taking +this medication, where details such as time, quantity, or rate or even medication product may be incomplete or missing +or less precise. As stated earlier, the medication statement information may come from the patient's memory, from a +prescription bottle or from a list of medications the patient, clinician or other party maintains. Medication +administration is more formal and is not missing detailed information. +*/ open class MedicationStatement: DomainResource { override open class var resourceType: String { get { return "MedicationStatement" } @@ -62,8 +63,8 @@ open class MedicationStatement: DomainResource { /// What medication was taken. public var medicationReference: Reference? - /// y | n | unk. - public var notTaken: String? + /// Indicator of the certainty of whether the medication was taken by the patient. + public var notTaken: MedicationStatementNotTaken? /// Further information about the statement. public var note: [Annotation]? @@ -80,12 +81,13 @@ open class MedicationStatement: DomainResource { /// True if asserting medication was not given. public var reasonNotTaken: [CodeableConcept]? - /// active | completed | entered-in-error | intended | stopped | on-hold. - public var status: String? + /// A code representing the patient or other source's judgment about the state of the medication used that this + /// statement is about. Generally this will be active or completed. + public var status: MedicationStatementStatus? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(medication: Any, patient: Reference, status: String) { + public convenience init(medication: Any, patient: Reference, status: MedicationStatementStatus) { self.init() if let value = medication as? CodeableConcept { self.medicationCodeableConcept = value @@ -231,7 +233,12 @@ open class MedicationStatement: DomainResource { if let exist = json["notTaken"] { presentKeys.insert("notTaken") if let val = exist as? String { - self.notTaken = val + if let enumval = MedicationStatementNotTaken(rawValue: val) { + self.notTaken = enumval + } + else { + errors.append(FHIRValidationError(key: "notTaken", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "notTaken", wants: String.self, has: type(of: exist))) @@ -313,7 +320,12 @@ open class MedicationStatement: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = MedicationStatementStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -364,7 +376,7 @@ open class MedicationStatement: DomainResource { json["medicationReference"] = medicationReference.asJSON(errors: &errors) } if let notTaken = self.notTaken { - json["notTaken"] = notTaken.asJSON() + json["notTaken"] = notTaken.rawValue } if let note = self.note { json["note"] = note.map() { $0.asJSON(errors: &errors) } @@ -382,7 +394,7 @@ open class MedicationStatement: DomainResource { json["reasonNotTaken"] = reasonNotTaken.map() { $0.asJSON(errors: &errors) } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } return json diff --git a/Sources/Models/MessageHeader.swift b/Sources/Models/MessageHeader.swift index 9b5a2709..f245d35e 100644 --- a/Sources/Models/MessageHeader.swift +++ b/Sources/Models/MessageHeader.swift @@ -2,7 +2,7 @@ // MessageHeader.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/MessageHeader) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/MessageHeader) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,12 +10,12 @@ import Foundation /** - * A resource that describes a message that is exchanged between systems. - * - * The header for a message exchange that is either requesting or responding to an action. The reference(s) that are - * the subject of the action as well as other information related to the action are typically transmitted in a bundle - * in which the MessageHeader resource instance is the first resource in the bundle. - */ +A resource that describes a message that is exchanged between systems. + +The header for a message exchange that is either requesting or responding to an action. The reference(s) that are the +subject of the action as well as other information related to the action are typically transmitted in a bundle in which +the MessageHeader resource instance is the first resource in the bundle. +*/ open class MessageHeader: DomainResource { override open class var resourceType: String { get { return "MessageHeader" } @@ -270,10 +270,10 @@ open class MessageHeader: DomainResource { /** - * Message Destination Application(s). - * - * The destination application which the message is intended for. - */ +Message Destination Application(s). + +The destination application which the message is intended for. +*/ open class MessageHeaderDestination: BackboneElement { override open class var resourceType: String { get { return "MessageHeaderDestination" } @@ -355,17 +355,18 @@ open class MessageHeaderDestination: BackboneElement { /** - * If this is a reply to prior message. - * - * Information about the message that this message is a response to. Only present if this message is a response. - */ +If this is a reply to prior message. + +Information about the message that this message is a response to. Only present if this message is a response. +*/ open class MessageHeaderResponse: BackboneElement { override open class var resourceType: String { get { return "MessageHeaderResponse" } } - /// ok | transient-error | fatal-error. - public var code: String? + /// Code that identifies the type of response to the message - whether it was successful or not, and whether it + /// should be resent or not. + public var code: ResponseType? /// Specific list of hints/warnings/errors. public var details: Reference? @@ -375,7 +376,7 @@ open class MessageHeaderResponse: BackboneElement { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(code: String, identifier: String) { + public convenience init(code: ResponseType, identifier: String) { self.init() self.code = code self.identifier = identifier @@ -387,7 +388,12 @@ open class MessageHeaderResponse: BackboneElement { if let exist = json["code"] { presentKeys.insert("code") if let val = exist as? String { - self.code = val + if let enumval = ResponseType(rawValue: val) { + self.code = enumval + } + else { + errors.append(FHIRValidationError(key: "code", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "code", wants: String.self, has: type(of: exist))) @@ -429,7 +435,7 @@ open class MessageHeaderResponse: BackboneElement { var json = super.asJSON(errors: &errors) if let code = self.code { - json["code"] = code.asJSON() + json["code"] = code.rawValue } if let details = self.details { json["details"] = details.asJSON(errors: &errors) @@ -444,10 +450,10 @@ open class MessageHeaderResponse: BackboneElement { /** - * Message Source Application. - * - * The source application from which this message originated. - */ +Message Source Application. + +The source application from which this message originated. +*/ open class MessageHeaderSource: BackboneElement { override open class var resourceType: String { get { return "MessageHeaderSource" } diff --git a/Sources/Models/Meta.swift b/Sources/Models/Meta.swift index 25b7ae4c..58e632b4 100644 --- a/Sources/Models/Meta.swift +++ b/Sources/Models/Meta.swift @@ -2,7 +2,7 @@ // Meta.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Meta) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Meta) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Metadata about a resource. - * - * The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to - * the content may not always be associated with version changes to the resource. - */ +Metadata about a resource. + +The metadata about a resource. This is content in the resource that is maintained by the infrastructure. Changes to the +content may not always be associated with version changes to the resource. +*/ open class Meta: Element { override open class var resourceType: String { get { return "Meta" } @@ -103,11 +103,7 @@ open class Meta: Element { json["lastUpdated"] = lastUpdated.asJSON() } if let profile = self.profile { - var arr = [Any]() - for val in profile { - arr.append(val.asJSON()) - } - json["profile"] = arr + json["profile"] = profile.map() { $0.asJSON() } } if let security = self.security { json["security"] = security.map() { $0.asJSON(errors: &errors) } diff --git a/Sources/Models/MetadataResource.swift b/Sources/Models/MetadataResource.swift index be23e4bf..93ee82ba 100644 --- a/Sources/Models/MetadataResource.swift +++ b/Sources/Models/MetadataResource.swift @@ -2,7 +2,7 @@ // MetadataResource.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/MetadataResource) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/MetadataResource) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Common Ancestor declaration for definitional resources. - * - * Common Ancestor declaration for conformance and knowledge artifact resources. - */ +Common Ancestor declaration for definitional resources. + +Common Ancestor declaration for conformance and knowledge artifact resources. +*/ open class MetadataResource: DomainResource { override open class var resourceType: String { get { return "MetadataResource" } @@ -40,8 +40,8 @@ open class MetadataResource: DomainResource { /// Name of the publisher (Organization or individual). public var publisher: String? - /// draft | active | retired. - public var status: String? + /// The status of this metadata resource. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Name for this metadata resource (Human friendly). public var title: String? @@ -57,7 +57,7 @@ open class MetadataResource: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: PublicationStatus) { self.init() self.status = status } @@ -141,7 +141,12 @@ open class MetadataResource: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -219,7 +224,7 @@ open class MetadataResource: DomainResource { json["publisher"] = publisher.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let title = self.title { json["title"] = title.asJSON() diff --git a/Sources/Models/Money.swift b/Sources/Models/Money.swift index 85322821..59b7a316 100644 --- a/Sources/Models/Money.swift +++ b/Sources/Models/Money.swift @@ -2,7 +2,7 @@ // Money.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Money) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Money) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,8 +10,8 @@ import Foundation /** - * An amount of economic utility in some recognised currency. - */ +An amount of economic utility in some recognised currency. +*/ open class Money: Quantity { override open class var resourceType: String { get { return "Money" } diff --git a/Sources/Models/NamingSystem.swift b/Sources/Models/NamingSystem.swift index ed658818..c0b19763 100644 --- a/Sources/Models/NamingSystem.swift +++ b/Sources/Models/NamingSystem.swift @@ -2,7 +2,7 @@ // NamingSystem.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/NamingSystem) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/NamingSystem) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * System of unique identification. - * - * A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, - * devices, etc. Represents a "System" used within the Identifier and Coding data types. - */ +System of unique identification. + +A curated namespace that issues unique symbols within that namespace for the identification of concepts, people, +devices, etc. Represents a "System" used within the Identifier and Coding data types. +*/ open class NamingSystem: DomainResource { override open class var resourceType: String { get { return "NamingSystem" } @@ -32,8 +32,8 @@ open class NamingSystem: DomainResource { /// Intended jurisdiction for naming system (if applicable). public var jurisdiction: [CodeableConcept]? - /// codesystem | identifier | root. - public var kind: String? + /// Indicates the purpose for the naming system - what kinds of things does it make unique? + public var kind: NamingSystemType? /// Name for this naming system (Computer friendly). public var name: String? @@ -47,8 +47,8 @@ open class NamingSystem: DomainResource { /// Who maintains system namespace?. public var responsible: String? - /// draft | active | retired. - public var status: String? + /// The status of this naming system. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// e.g. driver, provider, patient, bank etc.. public var type: CodeableConcept? @@ -64,7 +64,7 @@ open class NamingSystem: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(date: DateTime, kind: String, name: String, status: String, uniqueId: [NamingSystemUniqueId]) { + public convenience init(date: DateTime, kind: NamingSystemType, name: String, status: PublicationStatus, uniqueId: [NamingSystemUniqueId]) { self.init() self.date = date self.kind = kind @@ -128,7 +128,12 @@ open class NamingSystem: DomainResource { if let exist = json["kind"] { presentKeys.insert("kind") if let val = exist as? String { - self.kind = val + if let enumval = NamingSystemType(rawValue: val) { + self.kind = enumval + } + else { + errors.append(FHIRValidationError(key: "kind", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "kind", wants: String.self, has: type(of: exist))) @@ -184,7 +189,12 @@ open class NamingSystem: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -266,7 +276,7 @@ open class NamingSystem: DomainResource { json["jurisdiction"] = jurisdiction.map() { $0.asJSON(errors: &errors) } } if let kind = self.kind { - json["kind"] = kind.asJSON() + json["kind"] = kind.rawValue } if let name = self.name { json["name"] = name.asJSON() @@ -281,7 +291,7 @@ open class NamingSystem: DomainResource { json["responsible"] = responsible.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let type = self.type { json["type"] = type.asJSON(errors: &errors) @@ -302,10 +312,10 @@ open class NamingSystem: DomainResource { /** - * Unique identifiers used for system. - * - * Indicates how the system may be identified when referenced in electronic exchange. - */ +Unique identifiers used for system. + +Indicates how the system may be identified when referenced in electronic exchange. +*/ open class NamingSystemUniqueId: BackboneElement { override open class var resourceType: String { get { return "NamingSystemUniqueId" } @@ -320,15 +330,15 @@ open class NamingSystemUniqueId: BackboneElement { /// Is this the id that should be used for this type. public var preferred: Bool? - /// oid | uuid | uri | other. - public var type: String? + /// Identifies the unique identifier scheme used for this particular identifier. + public var type: NamingSystemIdentifierType? /// The unique identifier. public var value: String? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(type: String, value: String) { + public convenience init(type: NamingSystemIdentifierType, value: String) { self.init() self.type = type self.value = value @@ -372,7 +382,12 @@ open class NamingSystemUniqueId: BackboneElement { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = NamingSystemIdentifierType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -409,7 +424,7 @@ open class NamingSystemUniqueId: BackboneElement { json["preferred"] = preferred.asJSON() } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } if let value = self.value { json["value"] = value.asJSON() diff --git a/Sources/Models/Narrative.swift b/Sources/Models/Narrative.swift index ca079674..989590c2 100644 --- a/Sources/Models/Narrative.swift +++ b/Sources/Models/Narrative.swift @@ -2,7 +2,7 @@ // Narrative.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Narrative) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Narrative) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,8 +10,8 @@ import Foundation /** - * A human-readable formatted text, including images. - */ +A human-readable formatted text, including images. +*/ open class Narrative: Element { override open class var resourceType: String { get { return "Narrative" } @@ -20,12 +20,13 @@ open class Narrative: Element { /// Limited xhtml content. public var div: String? - /// generated | extensions | additional | empty. - public var status: String? + /// The status of the narrative - whether it's entirely generated (from just the defined data or the extensions + /// too), or whether a human authored it and it may contain additional data. + public var status: NarrativeStatus? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(div: String, status: String) { + public convenience init(div: String, status: NarrativeStatus) { self.init() self.div = div self.status = status @@ -49,7 +50,12 @@ open class Narrative: Element { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = NarrativeStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -68,7 +74,7 @@ open class Narrative: Element { json["div"] = div.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } return json diff --git a/Sources/Models/NutritionRequest.swift b/Sources/Models/NutritionRequest.swift index 0cd31a3f..1b172cb6 100644 --- a/Sources/Models/NutritionRequest.swift +++ b/Sources/Models/NutritionRequest.swift @@ -2,7 +2,7 @@ // NutritionRequest.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/NutritionRequest) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/NutritionRequest) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Diet, formula or nutritional supplement request. - * - * A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. - */ +Diet, formula or nutritional supplement request. + +A request to supply a diet, formula feeding (enteral) or oral nutritional supplement to a patient/resident. +*/ open class NutritionRequest: DomainResource { override open class var resourceType: String { get { return "NutritionRequest" } @@ -49,8 +49,8 @@ open class NutritionRequest: DomainResource { /// The person who requires the diet, formula or nutritional supplement. public var patient: Reference? - /// proposed | draft | planned | requested | active | on-hold | completed | cancelled | entered-in-error. - public var status: String? + /// The workflow status of the nutrition order/request. + public var status: NutritionOrderStatus? /// Supplement components. public var supplement: [NutritionRequestSupplement]? @@ -210,7 +210,12 @@ open class NutritionRequest: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = NutritionOrderStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -267,7 +272,7 @@ open class NutritionRequest: DomainResource { json["patient"] = patient.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let supplement = self.supplement { json["supplement"] = supplement.map() { $0.asJSON(errors: &errors) } @@ -279,11 +284,11 @@ open class NutritionRequest: DomainResource { /** - * Enteral formula components. - * - * Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to - * the oral cavity. - */ +Enteral formula components. + +Feeding provided through the gastrointestinal tract via a tube, catheter, or stoma that delivers nutrition distal to the +oral cavity. +*/ open class NutritionRequestEnteralFormula: BackboneElement { override open class var resourceType: String { get { return "NutritionRequestEnteralFormula" } @@ -470,12 +475,12 @@ open class NutritionRequestEnteralFormula: BackboneElement { /** - * Formula feeding instruction as structured data. - * - * Formula administration instructions as structured data. This repeating structure allows for changing the - * administration rate or volume over time for both bolus and continuous feeding. An example of this would be an - * instruction to increase the rate of continuous feeding every 2 hours. - */ +Formula feeding instruction as structured data. + +Formula administration instructions as structured data. This repeating structure allows for changing the administration +rate or volume over time for both bolus and continuous feeding. An example of this would be an instruction to increase +the rate of continuous feeding every 2 hours. +*/ open class NutritionRequestEnteralFormulaAdministration: BackboneElement { override open class var resourceType: String { get { return "NutritionRequestEnteralFormulaAdministration" } @@ -577,10 +582,10 @@ open class NutritionRequestEnteralFormulaAdministration: BackboneElement { /** - * Oral diet components. - * - * Diet given orally in contrast to enteral (tube) feeding. - */ +Oral diet components. + +Diet given orally in contrast to enteral (tube) feeding. +*/ open class NutritionRequestOralDiet: BackboneElement { override open class var resourceType: String { get { return "NutritionRequestOralDiet" } @@ -717,11 +722,11 @@ open class NutritionRequestOralDiet: BackboneElement { /** - * Required nutrient modifications. - * - * Class that defines the quantity and type of nutrient modifications (for example carbohydrate, fiber or sodium) - * required for the oral diet. - */ +Required nutrient modifications. + +Class that defines the quantity and type of nutrient modifications (for example carbohydrate, fiber or sodium) required +for the oral diet. +*/ open class NutritionRequestOralDietNutrient: BackboneElement { override open class var resourceType: String { get { return "NutritionRequestOralDietNutrient" } @@ -783,11 +788,10 @@ open class NutritionRequestOralDietNutrient: BackboneElement { /** - * Required texture modifications. - * - * Class that describes any texture modifications required for the patient to safely consume various types of solid - * foods. - */ +Required texture modifications. + +Class that describes any texture modifications required for the patient to safely consume various types of solid foods. +*/ open class NutritionRequestOralDietTexture: BackboneElement { override open class var resourceType: String { get { return "NutritionRequestOralDietTexture" } @@ -849,10 +853,10 @@ open class NutritionRequestOralDietTexture: BackboneElement { /** - * Supplement components. - * - * Oral nutritional products given in order to add further nutritional value to the patient's diet. - */ +Supplement components. + +Oral nutritional products given in order to add further nutritional value to the patient's diet. +*/ open class NutritionRequestSupplement: BackboneElement { override open class var resourceType: String { get { return "NutritionRequestSupplement" } diff --git a/Sources/Models/Observation.swift b/Sources/Models/Observation.swift index 70e03314..8a5ecbb8 100644 --- a/Sources/Models/Observation.swift +++ b/Sources/Models/Observation.swift @@ -2,7 +2,7 @@ // Observation.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Observation) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Observation) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Measurements and simple assertions. - * - * Measurements and simple assertions made about a patient, device or other subject. - */ +Measurements and simple assertions. + +Measurements and simple assertions made about a patient, device or other subject. +*/ open class Observation: DomainResource { override open class var resourceType: String { get { return "Observation" } @@ -73,8 +73,8 @@ open class Observation: DomainResource { /// Specimen used for this observation. public var specimen: Reference? - /// registered | preliminary | final | amended +. - public var status: String? + /// The status of the result value. + public var status: ObservationStatus? /// Who and/or what this is about. public var subject: Reference? @@ -111,7 +111,7 @@ open class Observation: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(code: CodeableConcept, status: String) { + public convenience init(code: CodeableConcept, status: ObservationStatus) { self.init() self.code = code self.status = status @@ -363,7 +363,12 @@ open class Observation: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = ObservationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -572,7 +577,7 @@ open class Observation: DomainResource { json["specimen"] = specimen.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) @@ -614,12 +619,12 @@ open class Observation: DomainResource { /** - * Component results. - * - * Some observations have multiple component observations. These component observations are expressed as separate code - * value pairs that share the same attributes. Examples include systolic and diastolic component observations for - * blood pressure measurement and multiple component observations for genetics observations. - */ +Component results. + +Some observations have multiple component observations. These component observations are expressed as separate code +value pairs that share the same attributes. Examples include systolic and diastolic component observations for blood +pressure measurement and multiple component observations for genetics observations. +*/ open class ObservationComponent: BackboneElement { override open class var resourceType: String { get { return "ObservationComponent" } @@ -916,10 +921,10 @@ open class ObservationComponent: BackboneElement { /** - * Provides guide for interpretation. - * - * Guidance on how to interpret the value by comparison to a normal or recommended range. - */ +Provides guide for interpretation. + +Guidance on how to interpret the value by comparison to a normal or recommended range. +*/ open class ObservationReferenceRange: BackboneElement { override open class var resourceType: String { get { return "ObservationReferenceRange" } @@ -1036,11 +1041,11 @@ open class ObservationReferenceRange: BackboneElement { /** - * Resource related to this observation. - * - * A reference to another resource (usually another Observation) whose relationship is defined by the relationship - * type code. - */ +Resource related to this observation. + +A reference to another resource (usually another Observation) whose relationship is defined by the relationship type +code. +*/ open class ObservationRelated: BackboneElement { override open class var resourceType: String { get { return "ObservationRelated" } @@ -1049,8 +1054,8 @@ open class ObservationRelated: BackboneElement { /// Resource that is related to this one. public var target: Reference? - /// has-member | derived-from | sequel-to | replaces | qualified-by | interfered-by. - public var type: String? + /// A code specifying the kind of relationship that exists with the target resource. + public var type: ObservationRelationshipType? /** Convenience initializer, taking all required properties as arguments. */ @@ -1082,7 +1087,12 @@ open class ObservationRelated: BackboneElement { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = ObservationRelationshipType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -1098,7 +1108,7 @@ open class ObservationRelated: BackboneElement { json["target"] = target.asJSON(errors: &errors) } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json diff --git a/Sources/Models/OperationDefinition.swift b/Sources/Models/OperationDefinition.swift index 804e247d..299873b7 100644 --- a/Sources/Models/OperationDefinition.swift +++ b/Sources/Models/OperationDefinition.swift @@ -2,7 +2,7 @@ // OperationDefinition.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/OperationDefinition) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/OperationDefinition) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Definition of an operation or a named query. - * - * A formal computable definition of an operation (on the RESTful interface) or a named query (using the search - * interaction). - */ +Definition of an operation or a named query. + +A formal computable definition of an operation (on the RESTful interface) or a named query (using the search +interaction). +*/ open class OperationDefinition: DomainResource { override open class var resourceType: String { get { return "OperationDefinition" } @@ -50,8 +50,8 @@ open class OperationDefinition: DomainResource { /// Intended jurisdiction for operation definition (if applicable). public var jurisdiction: [CodeableConcept]? - /// operation | query. - public var kind: String? + /// Whether this is an operation or a named query. + public var kind: OperationKind? /// Name for this operation definition (Computer friendly). public var name: String? @@ -71,8 +71,8 @@ open class OperationDefinition: DomainResource { /// Types this operation applies to. public var resource: [String]? - /// draft | active | retired. - public var status: String? + /// The status of this operation definition. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Invoke at the system level?. public var system: Bool? @@ -91,7 +91,7 @@ open class OperationDefinition: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(code: String, instance: Bool, kind: String, name: String, status: String, system: Bool, type: Bool) { + public convenience init(code: String, instance: Bool, kind: OperationKind, name: String, status: PublicationStatus, system: Bool, type: Bool) { self.init() self.code = code self.instance = instance @@ -219,7 +219,12 @@ open class OperationDefinition: DomainResource { if let exist = json["kind"] { presentKeys.insert("kind") if let val = exist as? String { - self.kind = val + if let enumval = OperationKind(rawValue: val) { + self.kind = enumval + } + else { + errors.append(FHIRValidationError(key: "kind", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "kind", wants: String.self, has: type(of: exist))) @@ -298,7 +303,12 @@ open class OperationDefinition: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -400,7 +410,7 @@ open class OperationDefinition: DomainResource { json["jurisdiction"] = jurisdiction.map() { $0.asJSON(errors: &errors) } } if let kind = self.kind { - json["kind"] = kind.asJSON() + json["kind"] = kind.rawValue } if let name = self.name { json["name"] = name.asJSON() @@ -418,14 +428,10 @@ open class OperationDefinition: DomainResource { json["purpose"] = purpose.asJSON() } if let resource = self.resource { - var arr = [Any]() - for val in resource { - arr.append(val.asJSON()) - } - json["resource"] = arr + json["resource"] = resource.map() { $0.asJSON() } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let system = self.system { json["system"] = system.asJSON() @@ -449,10 +455,10 @@ open class OperationDefinition: DomainResource { /** - * For generating overloaded methods in code. - * - * Defines an appropriate combination of parameters to use when invoking this operation. - */ +For generating overloaded methods in code. + +Defines an appropriate combination of parameters to use when invoking this operation. +*/ open class OperationDefinitionOverload: BackboneElement { override open class var resourceType: String { get { return "OperationDefinitionOverload" } @@ -495,11 +501,7 @@ open class OperationDefinitionOverload: BackboneElement { json["comment"] = comment.asJSON() } if let parameterName = self.parameterName { - var arr = [Any]() - for val in parameterName { - arr.append(val.asJSON()) - } - json["parameterName"] = arr + json["parameterName"] = parameterName.map() { $0.asJSON() } } return json @@ -508,10 +510,10 @@ open class OperationDefinitionOverload: BackboneElement { /** - * Parameters for the operation/query. - * - * The parameters for the operation/query. - */ +Parameters for the operation/query. + +The parameters for the operation/query. +*/ open class OperationDefinitionParameter: BackboneElement { override open class var resourceType: String { get { return "OperationDefinitionParameter" } @@ -538,18 +540,18 @@ open class OperationDefinitionParameter: BackboneElement { /// Profile on the type. public var profile: Reference? - /// number | date | string | token | reference | composite | quantity | uri. - public var searchType: String? + /// How the parameter is understood as a search parameter. This is only used if the parameter type is 'string'. + public var searchType: SearchParamType? /// What type this parameter has. public var type: String? - /// in | out. - public var use: String? + /// Whether this is an input or an output parameter. + public var use: OperationParameterUse? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(max: String, min: Int, name: String, use: String) { + public convenience init(max: String, min: Int, name: String, use: OperationParameterUse) { self.init() self.max = max self.min = min @@ -650,7 +652,12 @@ open class OperationDefinitionParameter: BackboneElement { if let exist = json["searchType"] { presentKeys.insert("searchType") if let val = exist as? String { - self.searchType = val + if let enumval = SearchParamType(rawValue: val) { + self.searchType = enumval + } + else { + errors.append(FHIRValidationError(key: "searchType", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "searchType", wants: String.self, has: type(of: exist))) @@ -668,7 +675,12 @@ open class OperationDefinitionParameter: BackboneElement { if let exist = json["use"] { presentKeys.insert("use") if let val = exist as? String { - self.use = val + if let enumval = OperationParameterUse(rawValue: val) { + self.use = enumval + } + else { + errors.append(FHIRValidationError(key: "use", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "use", wants: String.self, has: type(of: exist))) @@ -705,13 +717,13 @@ open class OperationDefinitionParameter: BackboneElement { json["profile"] = profile.asJSON(errors: &errors) } if let searchType = self.searchType { - json["searchType"] = searchType.asJSON() + json["searchType"] = searchType.rawValue } if let type = self.type { json["type"] = type.asJSON() } if let use = self.use { - json["use"] = use.asJSON() + json["use"] = use.rawValue } return json @@ -720,17 +732,18 @@ open class OperationDefinitionParameter: BackboneElement { /** - * ValueSet details if this is coded. - * - * Binds to a value set if this parameter is coded (code, Coding, CodeableConcept). - */ +ValueSet details if this is coded. + +Binds to a value set if this parameter is coded (code, Coding, CodeableConcept). +*/ open class OperationDefinitionParameterBinding: BackboneElement { override open class var resourceType: String { get { return "OperationDefinitionParameterBinding" } } - /// required | extensible | preferred | example. - public var strength: String? + /// Indicates the degree of conformance expectations associated with this binding - that is, the degree to which the + /// provided value set must be adhered to in the instances. + public var strength: BindingStrength? /// Source of value set. public var valueSetReference: Reference? @@ -740,7 +753,7 @@ open class OperationDefinitionParameterBinding: BackboneElement { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(strength: String, valueSet: Any) { + public convenience init(strength: BindingStrength, valueSet: Any) { self.init() self.strength = strength if let value = valueSet as? URL { @@ -760,7 +773,12 @@ open class OperationDefinitionParameterBinding: BackboneElement { if let exist = json["strength"] { presentKeys.insert("strength") if let val = exist as? String { - self.strength = val + if let enumval = BindingStrength(rawValue: val) { + self.strength = enumval + } + else { + errors.append(FHIRValidationError(key: "strength", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "strength", wants: String.self, has: type(of: exist))) @@ -804,7 +822,7 @@ open class OperationDefinitionParameterBinding: BackboneElement { var json = super.asJSON(errors: &errors) if let strength = self.strength { - json["strength"] = strength.asJSON() + json["strength"] = strength.rawValue } if let valueSetReference = self.valueSetReference { json["valueSetReference"] = valueSetReference.asJSON(errors: &errors) diff --git a/Sources/Models/OperationOutcome.swift b/Sources/Models/OperationOutcome.swift index 7de331d5..d65b106f 100644 --- a/Sources/Models/OperationOutcome.swift +++ b/Sources/Models/OperationOutcome.swift @@ -2,7 +2,7 @@ // OperationOutcome.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/OperationOutcome) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/OperationOutcome) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Information about the success/failure of an action. - * - * A collection of error, warning or information messages that result from a system action. - */ +Information about the success/failure of an action. + +A collection of error, warning or information messages that result from a system action. +*/ open class OperationOutcome: DomainResource { override open class var resourceType: String { get { return "OperationOutcome" } @@ -65,17 +65,18 @@ open class OperationOutcome: DomainResource { /** - * A single issue associated with the action. - * - * An error, warning or information message that results from a system action. - */ +A single issue associated with the action. + +An error, warning or information message that results from a system action. +*/ open class OperationOutcomeIssue: BackboneElement { override open class var resourceType: String { get { return "OperationOutcomeIssue" } } - /// Error or warning code. - public var code: String? + /// Describes the type of the issue. The system that creates an OperationOutcome SHALL choose the most applicable + /// code from the IssueType value set, and may additional provide its own code for the error in the details element. + public var code: IssueType? /// Additional details about the error. public var details: CodeableConcept? @@ -89,12 +90,12 @@ open class OperationOutcomeIssue: BackboneElement { /// XPath of element(s) related to issue. public var location: [String]? - /// fatal | error | warning | information. - public var severity: String? + /// Indicates whether the issue indicates a variation from successful processing. + public var severity: IssueSeverity? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(code: String, severity: String) { + public convenience init(code: IssueType, severity: IssueSeverity) { self.init() self.code = code self.severity = severity @@ -106,7 +107,12 @@ open class OperationOutcomeIssue: BackboneElement { if let exist = json["code"] { presentKeys.insert("code") if let val = exist as? String { - self.code = val + if let enumval = IssueType(rawValue: val) { + self.code = enumval + } + else { + errors.append(FHIRValidationError(key: "code", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "code", wants: String.self, has: type(of: exist))) @@ -159,7 +165,12 @@ open class OperationOutcomeIssue: BackboneElement { if let exist = json["severity"] { presentKeys.insert("severity") if let val = exist as? String { - self.severity = val + if let enumval = IssueSeverity(rawValue: val) { + self.severity = enumval + } + else { + errors.append(FHIRValidationError(key: "severity", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "severity", wants: String.self, has: type(of: exist))) @@ -175,7 +186,7 @@ open class OperationOutcomeIssue: BackboneElement { var json = super.asJSON(errors: &errors) if let code = self.code { - json["code"] = code.asJSON() + json["code"] = code.rawValue } if let details = self.details { json["details"] = details.asJSON(errors: &errors) @@ -184,21 +195,13 @@ open class OperationOutcomeIssue: BackboneElement { json["diagnostics"] = diagnostics.asJSON() } if let expression = self.expression { - var arr = [Any]() - for val in expression { - arr.append(val.asJSON()) - } - json["expression"] = arr + json["expression"] = expression.map() { $0.asJSON() } } if let location = self.location { - var arr = [Any]() - for val in location { - arr.append(val.asJSON()) - } - json["location"] = arr + json["location"] = location.map() { $0.asJSON() } } if let severity = self.severity { - json["severity"] = severity.asJSON() + json["severity"] = severity.rawValue } return json diff --git a/Sources/Models/Organization.swift b/Sources/Models/Organization.swift index d6bc2389..ef6cff37 100644 --- a/Sources/Models/Organization.swift +++ b/Sources/Models/Organization.swift @@ -2,7 +2,7 @@ // Organization.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Organization) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Organization) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,12 +10,12 @@ import Foundation /** - * A grouping of people or organizations with a common purpose. - * - * A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some - * form of collective action. Includes companies, institutions, corporations, departments, community groups, - * healthcare practice groups, etc. - */ +A grouping of people or organizations with a common purpose. + +A formally or informally recognized grouping of people or organizations formed for the purpose of achieving some form of +collective action. Includes companies, institutions, corporations, departments, community groups, healthcare practice +groups, etc. +*/ open class Organization: DomainResource { override open class var resourceType: String { get { return "Organization" } @@ -192,11 +192,7 @@ open class Organization: DomainResource { json["address"] = address.map() { $0.asJSON(errors: &errors) } } if let alias = self.alias { - var arr = [Any]() - for val in alias { - arr.append(val.asJSON()) - } - json["alias"] = arr + json["alias"] = alias.map() { $0.asJSON() } } if let contact = self.contact { json["contact"] = contact.map() { $0.asJSON(errors: &errors) } @@ -226,8 +222,8 @@ open class Organization: DomainResource { /** - * Contact for the organization for a certain purpose. - */ +Contact for the organization for a certain purpose. +*/ open class OrganizationContact: BackboneElement { override open class var resourceType: String { get { return "OrganizationContact" } diff --git a/Sources/Models/ParameterDefinition.swift b/Sources/Models/ParameterDefinition.swift index 00fa946a..a997fcbe 100644 --- a/Sources/Models/ParameterDefinition.swift +++ b/Sources/Models/ParameterDefinition.swift @@ -2,7 +2,7 @@ // ParameterDefinition.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ParameterDefinition) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ParameterDefinition) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Definition of a parameter to a module. - * - * The parameters to the module. This collection specifies both the input and output parameters. Input parameters are - * provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. - */ +Definition of a parameter to a module. + +The parameters to the module. This collection specifies both the input and output parameters. Input parameters are +provided by the caller as part of the $evaluate operation. Output parameters are included in the GuidanceResponse. +*/ open class ParameterDefinition: Element { override open class var resourceType: String { get { return "ParameterDefinition" } @@ -38,12 +38,12 @@ open class ParameterDefinition: Element { /// Type for the parameter. public var type: String? - /// input | output. - public var use: String? + /// Whether the parameter is input or output for the module. + public var use: OperationParameterUse? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(type: String, use: String) { + public convenience init(type: String, use: OperationParameterUse) { self.init() self.type = type self.use = use @@ -117,7 +117,12 @@ open class ParameterDefinition: Element { if let exist = json["use"] { presentKeys.insert("use") if let val = exist as? String { - self.use = val + if let enumval = OperationParameterUse(rawValue: val) { + self.use = enumval + } + else { + errors.append(FHIRValidationError(key: "use", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "use", wants: String.self, has: type(of: exist))) @@ -151,7 +156,7 @@ open class ParameterDefinition: Element { json["type"] = type.asJSON() } if let use = self.use { - json["use"] = use.asJSON() + json["use"] = use.rawValue } return json diff --git a/Sources/Models/Parameters.swift b/Sources/Models/Parameters.swift index 944a7edb..60c894f1 100644 --- a/Sources/Models/Parameters.swift +++ b/Sources/Models/Parameters.swift @@ -2,7 +2,7 @@ // Parameters.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Parameters) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Parameters) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Operation Request or Response. - * - * This special resource type is used to represent an operation request and response (operations.html). It has no other - * use, and there is no RESTful endpoint associated with it. - */ +Operation Request or Response. + +This special resource type is used to represent an operation request and response (operations.html). It has no other +use, and there is no RESTful endpoint associated with it. +*/ open class Parameters: Resource { override open class var resourceType: String { get { return "Parameters" } @@ -56,10 +56,10 @@ open class Parameters: Resource { /** - * Operation Parameter. - * - * A parameter passed to or received from the operation. - */ +Operation Parameter. + +A parameter passed to or received from the operation. +*/ open class ParametersParameter: BackboneElement { override open class var resourceType: String { get { return "ParametersParameter" } diff --git a/Sources/Models/Patient.swift b/Sources/Models/Patient.swift index 1f8abf35..5ec4d7bf 100644 --- a/Sources/Models/Patient.swift +++ b/Sources/Models/Patient.swift @@ -2,7 +2,7 @@ // Patient.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Patient) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Patient) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Information about an individual or animal receiving health care services. - * - * Demographics and other administrative information about an individual or animal receiving care or other health- - * related services. - */ +Information about an individual or animal receiving health care services. + +Demographics and other administrative information about an individual or animal receiving care or other health-related +services. +*/ open class Patient: DomainResource { override open class var resourceType: String { get { return "Patient" } @@ -44,8 +44,9 @@ open class Patient: DomainResource { /// Indicates if the individual is deceased or not. public var deceasedDateTime: DateTime? - /// male | female | other | unknown. - public var gender: String? + /// Administrative Gender - the gender that the patient is considered to have for administration and record keeping + /// purposes. + public var gender: AdministrativeGender? /// Patient's nominated primary care provider. public var generalPractitioner: [Reference]? @@ -175,7 +176,12 @@ open class Patient: DomainResource { if let exist = json["gender"] { presentKeys.insert("gender") if let val = exist as? String { - self.gender = val + if let enumval = AdministrativeGender(rawValue: val) { + self.gender = enumval + } + else { + errors.append(FHIRValidationError(key: "gender", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "gender", wants: String.self, has: type(of: exist))) @@ -342,7 +348,7 @@ open class Patient: DomainResource { json["deceasedDateTime"] = deceasedDateTime.asJSON() } if let gender = self.gender { - json["gender"] = gender.asJSON() + json["gender"] = gender.rawValue } if let generalPractitioner = self.generalPractitioner { json["generalPractitioner"] = generalPractitioner.map() { $0.asJSON(errors: &errors) } @@ -381,10 +387,10 @@ open class Patient: DomainResource { /** - * This patient is known to be an animal (non-human). - * - * This patient is known to be an animal. - */ +This patient is known to be an animal (non-human). + +This patient is known to be an animal. +*/ open class PatientAnimal: BackboneElement { override open class var resourceType: String { get { return "PatientAnimal" } @@ -476,10 +482,10 @@ open class PatientAnimal: BackboneElement { /** - * A list of Languages which may be used to communicate with the patient about his or her health. - * - * Languages which may be used to communicate with the patient about his or her health. - */ +A list of Languages which may be used to communicate with the patient about his or her health. + +Languages which may be used to communicate with the patient about his or her health. +*/ open class PatientCommunication: BackboneElement { override open class var resourceType: String { get { return "PatientCommunication" } @@ -546,8 +552,8 @@ open class PatientCommunication: BackboneElement { /** - * A contact party (e.g. guardian, partner, friend) for the patient. - */ +A contact party (e.g. guardian, partner, friend) for the patient. +*/ open class PatientContact: BackboneElement { override open class var resourceType: String { get { return "PatientContact" } @@ -556,8 +562,9 @@ open class PatientContact: BackboneElement { /// Address for the contact person. public var address: Address? - /// male | female | other | unknown. - public var gender: String? + /// Administrative Gender - the gender that the contact person is considered to have for administration and record + /// keeping purposes. + public var gender: AdministrativeGender? /// A name associated with the contact person. public var name: HumanName? @@ -594,7 +601,12 @@ open class PatientContact: BackboneElement { if let exist = json["gender"] { presentKeys.insert("gender") if let val = exist as? String { - self.gender = val + if let enumval = AdministrativeGender(rawValue: val) { + self.gender = enumval + } + else { + errors.append(FHIRValidationError(key: "gender", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "gender", wants: String.self, has: type(of: exist))) @@ -680,7 +692,7 @@ open class PatientContact: BackboneElement { json["address"] = address.asJSON(errors: &errors) } if let gender = self.gender { - json["gender"] = gender.asJSON() + json["gender"] = gender.rawValue } if let name = self.name { json["name"] = name.asJSON(errors: &errors) @@ -704,10 +716,10 @@ open class PatientContact: BackboneElement { /** - * Link to another patient resource that concerns the same actual person. - * - * Link to another patient resource that concerns the same actual patient. - */ +Link to another patient resource that concerns the same actual person. + +Link to another patient resource that concerns the same actual patient. +*/ open class PatientLink: BackboneElement { override open class var resourceType: String { get { return "PatientLink" } @@ -716,12 +728,12 @@ open class PatientLink: BackboneElement { /// The other patient or related person resource that the link refers to. public var other: Reference? - /// replace | refer | seealso - type of link. - public var type: String? + /// The type of link between this patient resource and another patient resource. + public var type: LinkType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(other: Reference, type: String) { + public convenience init(other: Reference, type: LinkType) { self.init() self.other = other self.type = type @@ -750,7 +762,12 @@ open class PatientLink: BackboneElement { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = LinkType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -769,7 +786,7 @@ open class PatientLink: BackboneElement { json["other"] = other.asJSON(errors: &errors) } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json diff --git a/Sources/Models/PaymentNotice.swift b/Sources/Models/PaymentNotice.swift index f3764398..490cd38a 100644 --- a/Sources/Models/PaymentNotice.swift +++ b/Sources/Models/PaymentNotice.swift @@ -2,7 +2,7 @@ // PaymentNotice.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/PaymentNotice) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/PaymentNotice) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * PaymentNotice request. - * - * This resource provides the status of the payment for goods and services rendered, and the request and response - * resource references. - */ +PaymentNotice request. + +This resource provides the status of the payment for goods and services rendered, and the request and response resource +references. +*/ open class PaymentNotice: DomainResource { override open class var resourceType: String { get { return "PaymentNotice" } @@ -47,8 +47,8 @@ open class PaymentNotice: DomainResource { /// Resource version. public var ruleset: Coding? - /// active | cancelled | draft | entered-in-error. - public var status: String? + /// The status of the resource instance. + public var status: PaymentNoticeStatus? /// Payment or clearing date. public var statusDate: FHIRDate? @@ -58,7 +58,7 @@ open class PaymentNotice: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(paymentStatus: Coding, status: String) { + public convenience init(paymentStatus: Coding, status: PaymentNoticeStatus) { self.init() self.paymentStatus = paymentStatus self.status = status @@ -194,7 +194,12 @@ open class PaymentNotice: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PaymentNoticeStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -260,7 +265,7 @@ open class PaymentNotice: DomainResource { json["ruleset"] = ruleset.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let statusDate = self.statusDate { json["statusDate"] = statusDate.asJSON() diff --git a/Sources/Models/PaymentReconciliation.swift b/Sources/Models/PaymentReconciliation.swift index 560f558e..716fcdac 100644 --- a/Sources/Models/PaymentReconciliation.swift +++ b/Sources/Models/PaymentReconciliation.swift @@ -2,7 +2,7 @@ // PaymentReconciliation.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/PaymentReconciliation) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/PaymentReconciliation) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * PaymentReconciliation resource. - * - * This resource provides payment details and claim references supporting a bulk payment. - */ +PaymentReconciliation resource. + +This resource provides payment details and claim references supporting a bulk payment. +*/ open class PaymentReconciliation: DomainResource { override open class var resourceType: String { get { return "PaymentReconciliation" } @@ -61,15 +61,15 @@ open class PaymentReconciliation: DomainResource { /// Resource version. public var ruleset: Coding? - /// active | cancelled | draft | entered-in-error. - public var status: String? + /// The status of the resource instance. + public var status: PaymentReconciliationStatus? /// Total amount of Payment. public var total: Money? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String, total: Money) { + public convenience init(status: PaymentReconciliationStatus, total: Money) { self.init() self.status = status self.total = total @@ -262,7 +262,12 @@ open class PaymentReconciliation: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PaymentReconciliationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -337,7 +342,7 @@ open class PaymentReconciliation: DomainResource { json["ruleset"] = ruleset.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let total = self.total { json["total"] = total.asJSON(errors: &errors) @@ -349,10 +354,10 @@ open class PaymentReconciliation: DomainResource { /** - * Details. - * - * List of individual settlement amounts and the corresponding transaction. - */ +Details. + +List of individual settlement amounts and the corresponding transaction. +*/ open class PaymentReconciliationDetail: BackboneElement { override open class var resourceType: String { get { return "PaymentReconciliationDetail" } @@ -519,10 +524,10 @@ open class PaymentReconciliationDetail: BackboneElement { /** - * Note text. - * - * Suite of notes. - */ +Note text. + +Suite of notes. +*/ open class PaymentReconciliationNote: BackboneElement { override open class var resourceType: String { get { return "PaymentReconciliationNote" } diff --git a/Sources/Models/Period.swift b/Sources/Models/Period.swift index bbf1b1c7..d6994d60 100644 --- a/Sources/Models/Period.swift +++ b/Sources/Models/Period.swift @@ -2,7 +2,7 @@ // Period.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Period) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Period) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Time range defined by start and end date/time. - * - * A time period defined by a start and end date and optionally time. - */ +Time range defined by start and end date/time. + +A time period defined by a start and end date and optionally time. +*/ open class Period: Element { override open class var resourceType: String { get { return "Period" } diff --git a/Sources/Models/Person.swift b/Sources/Models/Person.swift index 956bdee5..36b57e4a 100644 --- a/Sources/Models/Person.swift +++ b/Sources/Models/Person.swift @@ -2,7 +2,7 @@ // Person.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Person) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Person) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * A generic person record. - * - * Demographics and administrative information about a person independent of a specific health-related context. - */ +A generic person record. + +Demographics and administrative information about a person independent of a specific health-related context. +*/ open class Person: DomainResource { override open class var resourceType: String { get { return "Person" } @@ -28,8 +28,8 @@ open class Person: DomainResource { /// The date on which the person was born. public var birthDate: FHIRDate? - /// male | female | other | unknown. - public var gender: String? + /// Administrative Gender. + public var gender: AdministrativeGender? /// A human identifier for this person. public var identifier: [Identifier]? @@ -87,7 +87,12 @@ open class Person: DomainResource { if let exist = json["gender"] { presentKeys.insert("gender") if let val = exist as? String { - self.gender = val + if let enumval = AdministrativeGender(rawValue: val) { + self.gender = enumval + } + else { + errors.append(FHIRValidationError(key: "gender", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "gender", wants: String.self, has: type(of: exist))) @@ -193,7 +198,7 @@ open class Person: DomainResource { json["birthDate"] = birthDate.asJSON() } if let gender = self.gender { - json["gender"] = gender.asJSON() + json["gender"] = gender.rawValue } if let identifier = self.identifier { json["identifier"] = identifier.map() { $0.asJSON(errors: &errors) } @@ -220,15 +225,15 @@ open class Person: DomainResource { /** - * Link to a resource that concerns the same actual person. - */ +Link to a resource that concerns the same actual person. +*/ open class PersonLink: BackboneElement { override open class var resourceType: String { get { return "PersonLink" } } - /// level1 | level2 | level3 | level4. - public var assurance: String? + /// Level of assurance that this link is actually associated with the target resource. + public var assurance: IdentityAssuranceLevel? /// The resource to which this actual person is associated. public var target: Reference? @@ -246,7 +251,12 @@ open class PersonLink: BackboneElement { if let exist = json["assurance"] { presentKeys.insert("assurance") if let val = exist as? String { - self.assurance = val + if let enumval = IdentityAssuranceLevel(rawValue: val) { + self.assurance = enumval + } + else { + errors.append(FHIRValidationError(key: "assurance", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "assurance", wants: String.self, has: type(of: exist))) @@ -276,7 +286,7 @@ open class PersonLink: BackboneElement { var json = super.asJSON(errors: &errors) if let assurance = self.assurance { - json["assurance"] = assurance.asJSON() + json["assurance"] = assurance.rawValue } if let target = self.target { json["target"] = target.asJSON(errors: &errors) diff --git a/Sources/Models/PlanDefinition.swift b/Sources/Models/PlanDefinition.swift index 20ad7cdd..5bf12e9f 100644 --- a/Sources/Models/PlanDefinition.swift +++ b/Sources/Models/PlanDefinition.swift @@ -2,7 +2,7 @@ // PlanDefinition.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/PlanDefinition) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/PlanDefinition) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,12 +10,12 @@ import Foundation /** - * The definition of a plan for a series of actions, independent of any specific patient or context. - * - * This resource allows for the definition of various types of plans as a sharable, consumable, and executable - * artifact. The resource is general enough to support the description of a broad range of clinical artifacts such as - * clinical decision support rules, order sets and protocols. - */ +The definition of a plan for a series of actions, independent of any specific patient or context. + +This resource allows for the definition of various types of plans as a sharable, consumable, and executable artifact. +The resource is general enough to support the description of a broad range of clinical artifacts such as clinical +decision support rules, order sets and protocols. +*/ open class PlanDefinition: DomainResource { override open class var resourceType: String { get { return "PlanDefinition" } @@ -72,8 +72,8 @@ open class PlanDefinition: DomainResource { /// Related artifacts for the asset. public var relatedArtifact: [RelatedArtifact]? - /// draft | active | retired. - public var status: String? + /// The status of this plan definition. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Name for this plan definition (Human friendly). public var title: String? @@ -98,7 +98,7 @@ open class PlanDefinition: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: PublicationStatus) { self.init() self.status = status } @@ -302,7 +302,12 @@ open class PlanDefinition: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -447,7 +452,7 @@ open class PlanDefinition: DomainResource { json["relatedArtifact"] = relatedArtifact.map() { $0.asJSON(errors: &errors) } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let title = self.title { json["title"] = title.asJSON() @@ -477,10 +482,10 @@ open class PlanDefinition: DomainResource { /** - * Action defined by the plan. - * - * An action to be taken as part of the plan. - */ +Action defined by the plan. + +An action to be taken as part of the plan. +*/ open class PlanDefinitionActionDefinition: BackboneElement { override open class var resourceType: String { get { return "PlanDefinitionActionDefinition" } @@ -495,8 +500,8 @@ open class PlanDefinitionActionDefinition: BackboneElement { /// Description of the activity to be performed. public var activityDefinition: Reference? - /// single | multiple. - public var cardinalityBehavior: String? + /// Defines whether the action can be selected multiple times. + public var cardinalityBehavior: PlanActionCardinalityBehavior? /// The meaning of the action or its sub-actions. public var code: [CodeableConcept]? @@ -513,26 +518,26 @@ open class PlanDefinitionActionDefinition: BackboneElement { /// Dynamic aspects of the definition. public var dynamicValue: [PlanDefinitionActionDefinitionDynamicValue]? - /// visual-group | logical-group | sentence-group. - public var groupingBehavior: String? + /// Defines the grouping behavior for the action and its children. + public var groupingBehavior: PlanActionGroupingBehavior? /// User-visible label for the action (e.g. 1. or A.). public var label: String? - /// patient | practitioner | related-person. - public var participantType: [String]? + /// The type of participant in the action. + public var participantType: [PlanActionParticipantType]? - /// yes | no. - public var precheckBehavior: String? + /// Defines whether the action should usually be preselected. + public var precheckBehavior: PlanActionPrecheckBehavior? /// Relationship to another action. public var relatedAction: [PlanDefinitionActionDefinitionRelatedAction]? - /// must | could | must-unless-documented. - public var requiredBehavior: String? + /// Defines the requiredness behavior for the action. + public var requiredBehavior: PlanActionRequiredBehavior? - /// any | all | all-or-none | exactly-one | at-most-one | one-or-more. - public var selectionBehavior: String? + /// Defines the selection behavior for the action and its children. + public var selectionBehavior: PlanActionSelectionBehavior? /// Static text equivalent of the action, used if the dynamic aspects cannot be interpreted by the receiving system. public var textEquivalent: String? @@ -612,7 +617,12 @@ open class PlanDefinitionActionDefinition: BackboneElement { if let exist = json["cardinalityBehavior"] { presentKeys.insert("cardinalityBehavior") if let val = exist as? String { - self.cardinalityBehavior = val + if let enumval = PlanActionCardinalityBehavior(rawValue: val) { + self.cardinalityBehavior = enumval + } + else { + errors.append(FHIRValidationError(key: "cardinalityBehavior", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "cardinalityBehavior", wants: String.self, has: type(of: exist))) @@ -686,7 +696,12 @@ open class PlanDefinitionActionDefinition: BackboneElement { if let exist = json["groupingBehavior"] { presentKeys.insert("groupingBehavior") if let val = exist as? String { - self.groupingBehavior = val + if let enumval = PlanActionGroupingBehavior(rawValue: val) { + self.groupingBehavior = enumval + } + else { + errors.append(FHIRValidationError(key: "groupingBehavior", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "groupingBehavior", wants: String.self, has: type(of: exist))) @@ -703,8 +718,12 @@ open class PlanDefinitionActionDefinition: BackboneElement { } if let exist = json["participantType"] { presentKeys.insert("participantType") - if let val = exist as? [String] { - self.participantType = val + if let val = exist as? [String] { var i = -1 + self.participantType = val.map() { i += 1 + if let enumval = PlanActionParticipantType(rawValue: $0) { return enumval } + errors.append(FHIRValidationError(key: "participantType.\(i)", problem: "the value “\(val)” is not valid")) + return nil + }.filter() { nil != $0 }.map() { $0! } } else { errors.append(FHIRValidationError(key: "participantType", wants: Array.self, has: type(of: exist))) @@ -713,7 +732,12 @@ open class PlanDefinitionActionDefinition: BackboneElement { if let exist = json["precheckBehavior"] { presentKeys.insert("precheckBehavior") if let val = exist as? String { - self.precheckBehavior = val + if let enumval = PlanActionPrecheckBehavior(rawValue: val) { + self.precheckBehavior = enumval + } + else { + errors.append(FHIRValidationError(key: "precheckBehavior", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "precheckBehavior", wants: String.self, has: type(of: exist))) @@ -736,7 +760,12 @@ open class PlanDefinitionActionDefinition: BackboneElement { if let exist = json["requiredBehavior"] { presentKeys.insert("requiredBehavior") if let val = exist as? String { - self.requiredBehavior = val + if let enumval = PlanActionRequiredBehavior(rawValue: val) { + self.requiredBehavior = enumval + } + else { + errors.append(FHIRValidationError(key: "requiredBehavior", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "requiredBehavior", wants: String.self, has: type(of: exist))) @@ -745,7 +774,12 @@ open class PlanDefinitionActionDefinition: BackboneElement { if let exist = json["selectionBehavior"] { presentKeys.insert("selectionBehavior") if let val = exist as? String { - self.selectionBehavior = val + if let enumval = PlanActionSelectionBehavior(rawValue: val) { + self.selectionBehavior = enumval + } + else { + errors.append(FHIRValidationError(key: "selectionBehavior", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "selectionBehavior", wants: String.self, has: type(of: exist))) @@ -892,7 +926,7 @@ open class PlanDefinitionActionDefinition: BackboneElement { json["activityDefinition"] = activityDefinition.asJSON(errors: &errors) } if let cardinalityBehavior = self.cardinalityBehavior { - json["cardinalityBehavior"] = cardinalityBehavior.asJSON() + json["cardinalityBehavior"] = cardinalityBehavior.rawValue } if let code = self.code { json["code"] = code.map() { $0.asJSON(errors: &errors) } @@ -910,29 +944,25 @@ open class PlanDefinitionActionDefinition: BackboneElement { json["dynamicValue"] = dynamicValue.map() { $0.asJSON(errors: &errors) } } if let groupingBehavior = self.groupingBehavior { - json["groupingBehavior"] = groupingBehavior.asJSON() + json["groupingBehavior"] = groupingBehavior.rawValue } if let label = self.label { json["label"] = label.asJSON() } if let participantType = self.participantType { - var arr = [Any]() - for val in participantType { - arr.append(val.asJSON()) - } - json["participantType"] = arr + json["participantType"] = participantType.map() { $0.rawValue } } if let precheckBehavior = self.precheckBehavior { - json["precheckBehavior"] = precheckBehavior.asJSON() + json["precheckBehavior"] = precheckBehavior.rawValue } if let relatedAction = self.relatedAction { json["relatedAction"] = relatedAction.map() { $0.asJSON(errors: &errors) } } if let requiredBehavior = self.requiredBehavior { - json["requiredBehavior"] = requiredBehavior.asJSON() + json["requiredBehavior"] = requiredBehavior.rawValue } if let selectionBehavior = self.selectionBehavior { - json["selectionBehavior"] = selectionBehavior.asJSON() + json["selectionBehavior"] = selectionBehavior.rawValue } if let textEquivalent = self.textEquivalent { json["textEquivalent"] = textEquivalent.asJSON() @@ -971,10 +1001,10 @@ open class PlanDefinitionActionDefinition: BackboneElement { /** - * Whether or not the action is applicable. - * - * An expression specifying whether or not the action is applicable in a given context. - */ +Whether or not the action is applicable. + +An expression specifying whether or not the action is applicable in a given context. +*/ open class PlanDefinitionActionDefinitionCondition: BackboneElement { override open class var resourceType: String { get { return "PlanDefinitionActionDefinitionCondition" } @@ -1041,12 +1071,12 @@ open class PlanDefinitionActionDefinitionCondition: BackboneElement { /** - * Dynamic aspects of the definition. - * - * Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication - * must be computed based on the patient's weight, a customization would be used to specify an expression that - * calculated the weight, and the path on the resource that would contain the result. - */ +Dynamic aspects of the definition. + +Customizations that should be applied to the statically defined resource. For example, if the dosage of a medication +must be computed based on the patient's weight, a customization would be used to specify an expression that calculated +the weight, and the path on the resource that would contain the result. +*/ open class PlanDefinitionActionDefinitionDynamicValue: BackboneElement { override open class var resourceType: String { get { return "PlanDefinitionActionDefinitionDynamicValue" } @@ -1128,10 +1158,10 @@ open class PlanDefinitionActionDefinitionDynamicValue: BackboneElement { /** - * Relationship to another action. - * - * A relationship to another action such as "before" or "30-60 minutes after start of". - */ +Relationship to another action. + +A relationship to another action such as "before" or "30-60 minutes after start of". +*/ open class PlanDefinitionActionDefinitionRelatedAction: BackboneElement { override open class var resourceType: String { get { return "PlanDefinitionActionDefinitionRelatedAction" } @@ -1146,12 +1176,12 @@ open class PlanDefinitionActionDefinitionRelatedAction: BackboneElement { /// Time offset for the relationship. public var offsetRange: Range? - /// before-start | before | before-end | concurrent-with-start | concurrent | concurrent-with-end | after-start | after | after-end. - public var relationship: String? + /// The relationship of this action to the related action. + public var relationship: PlanActionRelationshipType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(actionIdentifier: Identifier, relationship: String) { + public convenience init(actionIdentifier: Identifier, relationship: PlanActionRelationshipType) { self.init() self.actionIdentifier = actionIdentifier self.relationship = relationship @@ -1208,7 +1238,12 @@ open class PlanDefinitionActionDefinitionRelatedAction: BackboneElement { if let exist = json["relationship"] { presentKeys.insert("relationship") if let val = exist as? String { - self.relationship = val + if let enumval = PlanActionRelationshipType(rawValue: val) { + self.relationship = enumval + } + else { + errors.append(FHIRValidationError(key: "relationship", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "relationship", wants: String.self, has: type(of: exist))) @@ -1233,7 +1268,7 @@ open class PlanDefinitionActionDefinitionRelatedAction: BackboneElement { json["offsetRange"] = offsetRange.asJSON(errors: &errors) } if let relationship = self.relationship { - json["relationship"] = relationship.asJSON() + json["relationship"] = relationship.rawValue } return json diff --git a/Sources/Models/Practitioner.swift b/Sources/Models/Practitioner.swift index 69afd03e..1df4c635 100644 --- a/Sources/Models/Practitioner.swift +++ b/Sources/Models/Practitioner.swift @@ -2,7 +2,7 @@ // Practitioner.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Practitioner) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Practitioner) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * A person with a formal responsibility in the provisioning of healthcare or related services. - * - * A person who is directly or indirectly involved in the provisioning of healthcare. - */ +A person with a formal responsibility in the provisioning of healthcare or related services. + +A person who is directly or indirectly involved in the provisioning of healthcare. +*/ open class Practitioner: DomainResource { override open class var resourceType: String { get { return "Practitioner" } @@ -31,8 +31,9 @@ open class Practitioner: DomainResource { /// A language the practitioner is able to use in patient communication. public var communication: [CodeableConcept]? - /// male | female | other | unknown. - public var gender: String? + /// Administrative Gender - the gender that the person is considered to have for administration and record keeping + /// purposes. + public var gender: AdministrativeGender? /// A identifier for the person as this agent. public var identifier: [Identifier]? @@ -104,7 +105,12 @@ open class Practitioner: DomainResource { if let exist = json["gender"] { presentKeys.insert("gender") if let val = exist as? String { - self.gender = val + if let enumval = AdministrativeGender(rawValue: val) { + self.gender = enumval + } + else { + errors.append(FHIRValidationError(key: "gender", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "gender", wants: String.self, has: type(of: exist))) @@ -213,7 +219,7 @@ open class Practitioner: DomainResource { json["communication"] = communication.map() { $0.asJSON(errors: &errors) } } if let gender = self.gender { - json["gender"] = gender.asJSON() + json["gender"] = gender.rawValue } if let identifier = self.identifier { json["identifier"] = identifier.map() { $0.asJSON(errors: &errors) } @@ -240,10 +246,10 @@ open class Practitioner: DomainResource { /** - * Roles/organizations the practitioner is associated with. - * - * The list of roles/organizations that the practitioner is associated with. - */ +Roles/organizations the practitioner is associated with. + +The list of roles/organizations that the practitioner is associated with. +*/ open class PractitionerPractRole: BackboneElement { override open class var resourceType: String { get { return "PractitionerPractRole" } @@ -445,8 +451,8 @@ open class PractitionerPractRole: BackboneElement { /** - * Qualifications obtained by training and certification. - */ +Qualifications obtained by training and certification. +*/ open class PractitionerQualification: BackboneElement { override open class var resourceType: String { get { return "PractitionerQualification" } diff --git a/Sources/Models/PractitionerRole.swift b/Sources/Models/PractitionerRole.swift index 60fb85a4..b82a2785 100644 --- a/Sources/Models/PractitionerRole.swift +++ b/Sources/Models/PractitionerRole.swift @@ -2,7 +2,7 @@ // PractitionerRole.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/PractitionerRole) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/PractitionerRole) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Roles/organizations the practitioner is associated with. - * - * A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a - * period of time. - */ +Roles/organizations the practitioner is associated with. + +A specific set of Roles/Locations/specialties/services that a practitioner may perform at an organization for a period +of time. +*/ open class PractitionerRole: DomainResource { override open class var resourceType: String { get { return "PractitionerRole" } @@ -306,10 +306,10 @@ open class PractitionerRole: DomainResource { /** - * Times the Service Site is available. - * - * A collection of times that the Service Site is available. - */ +Times the Service Site is available. + +A collection of times that the Service Site is available. +*/ open class PractitionerRoleAvailableTime: BackboneElement { override open class var resourceType: String { get { return "PractitionerRoleAvailableTime" } @@ -324,8 +324,8 @@ open class PractitionerRoleAvailableTime: BackboneElement { /// Opening time of day (ignored if allDay = true). public var availableStartTime: FHIRTime? - /// mon | tue | wed | thu | fri | sat | sun. - public var daysOfWeek: [String]? + /// Indicates which days of the week are available between the start and end Times. + public var daysOfWeek: [DaysOfWeek]? override open func populate(from json: FHIRJSON, presentKeys: inout Set) throws -> [FHIRValidationError]? { @@ -359,8 +359,12 @@ open class PractitionerRoleAvailableTime: BackboneElement { } if let exist = json["daysOfWeek"] { presentKeys.insert("daysOfWeek") - if let val = exist as? [String] { - self.daysOfWeek = val + if let val = exist as? [String] { var i = -1 + self.daysOfWeek = val.map() { i += 1 + if let enumval = DaysOfWeek(rawValue: $0) { return enumval } + errors.append(FHIRValidationError(key: "daysOfWeek.\(i)", problem: "the value “\(val)” is not valid")) + return nil + }.filter() { nil != $0 }.map() { $0! } } else { errors.append(FHIRValidationError(key: "daysOfWeek", wants: Array.self, has: type(of: exist))) @@ -382,11 +386,7 @@ open class PractitionerRoleAvailableTime: BackboneElement { json["availableStartTime"] = availableStartTime.asJSON() } if let daysOfWeek = self.daysOfWeek { - var arr = [Any]() - for val in daysOfWeek { - arr.append(val.asJSON()) - } - json["daysOfWeek"] = arr + json["daysOfWeek"] = daysOfWeek.map() { $0.rawValue } } return json @@ -395,10 +395,10 @@ open class PractitionerRoleAvailableTime: BackboneElement { /** - * Not available during this time due to provided reason. - * - * The HealthcareService is not available during this period of time due to the provided reason. - */ +Not available during this time due to provided reason. + +The HealthcareService is not available during this period of time due to the provided reason. +*/ open class PractitionerRoleNotAvailable: BackboneElement { override open class var resourceType: String { get { return "PractitionerRoleNotAvailable" } diff --git a/Sources/Models/Procedure.swift b/Sources/Models/Procedure.swift index dc8da2a9..6d6a2008 100644 --- a/Sources/Models/Procedure.swift +++ b/Sources/Models/Procedure.swift @@ -2,7 +2,7 @@ // Procedure.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Procedure) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Procedure) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * An action that is being or was performed on a patient. - * - * An action that is or was performed on a patient. This can be a physical intervention like an operation, or less - * invasive like counseling or hypnotherapy. - */ +An action that is being or was performed on a patient. + +An action that is or was performed on a patient. This can be a physical intervention like an operation, or less invasive +like counseling or hypnotherapy. +*/ open class Procedure: DomainResource { override open class var resourceType: String { get { return "Procedure" } @@ -83,8 +83,8 @@ open class Procedure: DomainResource { /// A request for this procedure. public var request: Reference? - /// in-progress | aborted | completed | entered-in-error. - public var status: String? + /// A code specifying the state of the procedure. Generally this will be in-progress or completed state. + public var status: ProcedureStatus? /// Who the procedure was performed on. public var subject: Reference? @@ -97,7 +97,7 @@ open class Procedure: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(code: CodeableConcept, status: String, subject: Reference) { + public convenience init(code: CodeableConcept, status: ProcedureStatus, subject: Reference) { self.init() self.code = code self.status = status @@ -397,7 +397,12 @@ open class Procedure: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = ProcedureStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -521,7 +526,7 @@ open class Procedure: DomainResource { json["request"] = request.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) @@ -539,11 +544,11 @@ open class Procedure: DomainResource { /** - * Device changed in procedure. - * - * A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a - * prosthesis, attaching a wound-vac, etc.) as a focal portion of the Procedure. - */ +Device changed in procedure. + +A device that is implanted, removed or otherwise manipulated (calibration, battery replacement, fitting a prosthesis, +attaching a wound-vac, etc.) as a focal portion of the Procedure. +*/ open class ProcedureFocalDevice: BackboneElement { override open class var resourceType: String { get { return "ProcedureFocalDevice" } @@ -615,10 +620,10 @@ open class ProcedureFocalDevice: BackboneElement { /** - * The people who performed the procedure. - * - * Limited to 'real' people rather than equipment. - */ +The people who performed the procedure. + +Limited to 'real' people rather than equipment. +*/ open class ProcedurePerformer: BackboneElement { override open class var resourceType: String { get { return "ProcedurePerformer" } diff --git a/Sources/Models/ProcedureRequest.swift b/Sources/Models/ProcedureRequest.swift index 332be90c..ccec0fc9 100644 --- a/Sources/Models/ProcedureRequest.swift +++ b/Sources/Models/ProcedureRequest.swift @@ -2,7 +2,7 @@ // ProcedureRequest.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ProcedureRequest) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ProcedureRequest) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * A request for a procedure to be performed. - * - * A request for a procedure to be performed. May be a proposal or an order. - */ +A request for a procedure to be performed. + +A request for a procedure to be performed. May be a proposal or an order. +*/ open class ProcedureRequest: DomainResource { override open class var resourceType: String { get { return "ProcedureRequest" } @@ -49,8 +49,8 @@ open class ProcedureRequest: DomainResource { /// Who should perform the procedure. public var performer: Reference? - /// routine | urgent | stat | asap. - public var priority: String? + /// The clinical priority associated with this order. + public var priority: ProcedureRequestPriority? /// Why procedure should occur. public var reasonCodeableConcept: CodeableConcept? @@ -67,12 +67,15 @@ open class ProcedureRequest: DomainResource { /// When procedure should occur. public var scheduledTiming: Timing? - /// proposed | draft | requested | received | accepted | in-progress | completed | suspended | rejected | aborted. - public var status: String? + /// The status of the order. + public var status: ProcedureRequestStatus? /// Who the procedure should be done to. public var subject: Reference? + /// Extra information to use in performing request. + public var supportingInfo: [Reference]? + /** Convenience initializer, taking all required properties as arguments. */ public convenience init(code: CodeableConcept, subject: Reference) { @@ -220,7 +223,12 @@ open class ProcedureRequest: DomainResource { if let exist = json["priority"] { presentKeys.insert("priority") if let val = exist as? String { - self.priority = val + if let enumval = ProcedureRequestPriority(rawValue: val) { + self.priority = enumval + } + else { + errors.append(FHIRValidationError(key: "priority", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "priority", wants: String.self, has: type(of: exist))) @@ -294,7 +302,12 @@ open class ProcedureRequest: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = ProcedureRequestStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -317,6 +330,20 @@ open class ProcedureRequest: DomainResource { else { errors.append(FHIRValidationError(missing: "subject")) } + if let exist = json["supportingInfo"] { + presentKeys.insert("supportingInfo") + if let val = exist as? [FHIRJSON] { + do { + self.supportingInfo = try Reference.instantiate(fromArray: val, owner: self) as? [Reference] + } + catch let error as FHIRValidationError { + errors.append(error.prefixed(with: "supportingInfo")) + } + } + else { + errors.append(FHIRValidationError(key: "supportingInfo", wants: Array.self, has: type(of: exist))) + } + } return errors.isEmpty ? nil : errors } @@ -354,7 +381,7 @@ open class ProcedureRequest: DomainResource { json["performer"] = performer.asJSON(errors: &errors) } if let priority = self.priority { - json["priority"] = priority.asJSON() + json["priority"] = priority.rawValue } if let reasonCodeableConcept = self.reasonCodeableConcept { json["reasonCodeableConcept"] = reasonCodeableConcept.asJSON(errors: &errors) @@ -372,11 +399,14 @@ open class ProcedureRequest: DomainResource { json["scheduledTiming"] = scheduledTiming.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) } + if let supportingInfo = self.supportingInfo { + json["supportingInfo"] = supportingInfo.map() { $0.asJSON(errors: &errors) } + } return json } diff --git a/Sources/Models/ProcessRequest.swift b/Sources/Models/ProcessRequest.swift index 13bddc37..7dafb122 100644 --- a/Sources/Models/ProcessRequest.swift +++ b/Sources/Models/ProcessRequest.swift @@ -2,7 +2,7 @@ // ProcessRequest.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ProcessRequest) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ProcessRequest) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,18 +10,19 @@ import Foundation /** - * Process request. - * - * This resource provides the target, request and response, and action details for an action to be performed by the - * target on or about existing resources. - */ +Process request. + +This resource provides the target, request and response, and action details for an action to be performed by the target +on or about existing resources. +*/ open class ProcessRequest: DomainResource { override open class var resourceType: String { get { return "ProcessRequest" } } - /// cancel | poll | reprocess | status. - public var action: String? + /// The type of processing action being requested, for example Reversal, Readjudication, + /// StatusRequest,PendedRequest. + public var action: ActionList? /// Creation date. public var created: DateTime? @@ -65,15 +66,15 @@ open class ProcessRequest: DomainResource { /// Resource version. public var ruleset: Coding? - /// active | cancelled | draft | entered-in-error. - public var status: String? + /// The status of the resource instance. + public var status: ProcessRequestStatus? /// Target of the request. public var target: Reference? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(action: String, status: String) { + public convenience init(action: ActionList, status: ProcessRequestStatus) { self.init() self.action = action self.status = status @@ -85,7 +86,12 @@ open class ProcessRequest: DomainResource { if let exist = json["action"] { presentKeys.insert("action") if let val = exist as? String { - self.action = val + if let enumval = ActionList(rawValue: val) { + self.action = enumval + } + else { + errors.append(FHIRValidationError(key: "action", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "action", wants: String.self, has: type(of: exist))) @@ -268,7 +274,12 @@ open class ProcessRequest: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = ProcessRequestStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -298,27 +309,19 @@ open class ProcessRequest: DomainResource { var json = super.asJSON(errors: &errors) if let action = self.action { - json["action"] = action.asJSON() + json["action"] = action.rawValue } if let created = self.created { json["created"] = created.asJSON() } if let exclude = self.exclude { - var arr = [Any]() - for val in exclude { - arr.append(val.asJSON()) - } - json["exclude"] = arr + json["exclude"] = exclude.map() { $0.asJSON() } } if let identifier = self.identifier { json["identifier"] = identifier.map() { $0.asJSON(errors: &errors) } } if let include = self.include { - var arr = [Any]() - for val in include { - arr.append(val.asJSON()) - } - json["include"] = arr + json["include"] = include.map() { $0.asJSON() } } if let item = self.item { json["item"] = item.map() { $0.asJSON(errors: &errors) } @@ -351,7 +354,7 @@ open class ProcessRequest: DomainResource { json["ruleset"] = ruleset.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let target = self.target { json["target"] = target.asJSON(errors: &errors) @@ -363,10 +366,10 @@ open class ProcessRequest: DomainResource { /** - * Items to re-adjudicate. - * - * List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated. - */ +Items to re-adjudicate. + +List of top level items to be re-adjudicated, if none specified then the entire submission is re-adjudicated. +*/ open class ProcessRequestItem: BackboneElement { override open class var resourceType: String { get { return "ProcessRequestItem" } diff --git a/Sources/Models/ProcessResponse.swift b/Sources/Models/ProcessResponse.swift index 9540d72b..6f6d8ff7 100644 --- a/Sources/Models/ProcessResponse.swift +++ b/Sources/Models/ProcessResponse.swift @@ -2,7 +2,7 @@ // ProcessResponse.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ProcessResponse) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ProcessResponse) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * ProcessResponse resource. - * - * This resource provides processing status, errors and notes from the processing of a resource. - */ +ProcessResponse resource. + +This resource provides processing status, errors and notes from the processing of a resource. +*/ open class ProcessResponse: DomainResource { override open class var resourceType: String { get { return "ProcessResponse" } @@ -58,12 +58,12 @@ open class ProcessResponse: DomainResource { /// Resource version. public var ruleset: Coding? - /// active | cancelled | draft | entered-in-error. - public var status: String? + /// The status of the resource instance. + public var status: ProcessResponseStatus? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: ProcessResponseStatus) { self.init() self.status = status } @@ -246,7 +246,12 @@ open class ProcessResponse: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = ProcessResponseStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -301,7 +306,7 @@ open class ProcessResponse: DomainResource { json["ruleset"] = ruleset.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } return json @@ -310,10 +315,10 @@ open class ProcessResponse: DomainResource { /** - * Notes. - * - * Suite of processing note or additional requirements is the processing has been held. - */ +Notes. + +Suite of processing note or additional requirements is the processing has been held. +*/ open class ProcessResponseNotes: BackboneElement { override open class var resourceType: String { get { return "ProcessResponseNotes" } diff --git a/Sources/Models/Provenance.swift b/Sources/Models/Provenance.swift index ec12f4c9..20564876 100644 --- a/Sources/Models/Provenance.swift +++ b/Sources/Models/Provenance.swift @@ -2,7 +2,7 @@ // Provenance.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Provenance) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Provenance) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,16 +10,15 @@ import Foundation /** - * Who, What, When for a set of resources. - * - * Provenance of a resource is a record that describes entities and processes involved in producing and delivering or - * otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling - * trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves - * become important records with their own provenance. Provenance statement indicates clinical significance in terms of - * confidence in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document - * Completion - has the artifact been legally authenticated), all of which may impact security, privacy, and trust - * policies. - */ +Who, What, When for a set of resources. + +Provenance of a resource is a record that describes entities and processes involved in producing and delivering or +otherwise influencing that resource. Provenance provides a critical foundation for assessing authenticity, enabling +trust, and allowing reproducibility. Provenance assertions are a form of contextual metadata and can themselves become +important records with their own provenance. Provenance statement indicates clinical significance in terms of confidence +in authenticity, reliability, and trustworthiness, integrity, and stage in lifecycle (e.g. Document Completion - has the +artifact been legally authenticated), all of which may impact security, privacy, and trust policies. +*/ open class Provenance: DomainResource { override open class var resourceType: String { get { return "Provenance" } @@ -228,11 +227,7 @@ open class Provenance: DomainResource { json["period"] = period.asJSON(errors: &errors) } if let policy = self.policy { - var arr = [Any]() - for val in policy { - arr.append(val.asJSON()) - } - json["policy"] = arr + json["policy"] = policy.map() { $0.asJSON() } } if let reason = self.reason { json["reason"] = reason.map() { $0.asJSON(errors: &errors) } @@ -253,11 +248,11 @@ open class Provenance: DomainResource { /** - * Actor involved. - * - * An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity - * taking place. - */ +Actor involved. + +An actor taking a role in an activity for which it can be assigned some degree of responsibility for the activity +taking place. +*/ open class ProvenanceAgent: BackboneElement { override open class var resourceType: String { get { return "ProvenanceAgent" } @@ -369,12 +364,12 @@ open class ProvenanceAgent: BackboneElement { /** - * Track delegation between agents. - * - * A relationship between two the agents referenced in this resource. This is defined to allow for explicit description - * of the delegation between agents. For example, this human author used this device, or one person acted on another's - * behest. - */ +Track delegation between agents. + +A relationship between two the agents referenced in this resource. This is defined to allow for explicit description of +the delegation between agents. For example, this human author used this device, or one person acted on another's +behest. +*/ open class ProvenanceAgentRelatedAgent: BackboneElement { override open class var resourceType: String { get { return "ProvenanceAgentRelatedAgent" } @@ -445,8 +440,8 @@ open class ProvenanceAgentRelatedAgent: BackboneElement { /** - * An entity used in this activity. - */ +An entity used in this activity. +*/ open class ProvenanceEntity: BackboneElement { override open class var resourceType: String { get { return "ProvenanceEntity" } @@ -461,15 +456,15 @@ open class ProvenanceEntity: BackboneElement { /// Identity of entity. public var reference: URL? - /// derivation | revision | quotation | source | removal. - public var role: String? + /// How the entity was used during the activity. + public var role: ProvenanceEntityRole? /// The type of resource in this entity. public var type: Coding? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(reference: URL, role: String, type: Coding) { + public convenience init(reference: URL, role: ProvenanceEntityRole, type: Coding) { self.init() self.reference = reference self.role = role @@ -517,7 +512,12 @@ open class ProvenanceEntity: BackboneElement { if let exist = json["role"] { presentKeys.insert("role") if let val = exist as? String { - self.role = val + if let enumval = ProvenanceEntityRole(rawValue: val) { + self.role = enumval + } + else { + errors.append(FHIRValidationError(key: "role", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "role", wants: String.self, has: type(of: exist))) @@ -559,7 +559,7 @@ open class ProvenanceEntity: BackboneElement { json["reference"] = reference.asJSON() } if let role = self.role { - json["role"] = role.asJSON() + json["role"] = role.rawValue } if let type = self.type { json["type"] = type.asJSON(errors: &errors) diff --git a/Sources/Models/Quantity.swift b/Sources/Models/Quantity.swift index 680354aa..97ad1366 100644 --- a/Sources/Models/Quantity.swift +++ b/Sources/Models/Quantity.swift @@ -2,7 +2,7 @@ // Quantity.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Quantity) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Quantity) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * A measured or measurable amount. - * - * A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that - * are not precisely quantified, including amounts involving arbitrary units and floating currencies. - */ +A measured or measurable amount. + +A measured amount (or an amount that can potentially be measured). Note that measured amounts include amounts that are +not precisely quantified, including amounts involving arbitrary units and floating currencies. +*/ open class Quantity: Element { override open class var resourceType: String { get { return "Quantity" } @@ -23,8 +23,9 @@ open class Quantity: Element { /// Coded form of the unit. public var code: String? - /// < | <= | >= | > - how to understand the value. - public var comparator: String? + /// How the value should be understood and represented - whether the actual value is greater or less than the stated + /// value due to measurement issues; e.g. if the comparator is "<" , then the real value is < stated value. + public var comparator: QuantityComparator? /// System that defines coded unit form. public var system: URL? @@ -50,7 +51,12 @@ open class Quantity: Element { if let exist = json["comparator"] { presentKeys.insert("comparator") if let val = exist as? String { - self.comparator = val + if let enumval = QuantityComparator(rawValue: val) { + self.comparator = enumval + } + else { + errors.append(FHIRValidationError(key: "comparator", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "comparator", wants: String.self, has: type(of: exist))) @@ -93,7 +99,7 @@ open class Quantity: Element { json["code"] = code.asJSON() } if let comparator = self.comparator { - json["comparator"] = comparator.asJSON() + json["comparator"] = comparator.rawValue } if let system = self.system { json["system"] = system.asJSON() diff --git a/Sources/Models/Questionnaire.swift b/Sources/Models/Questionnaire.swift index 13dae3e1..4beb6a3e 100644 --- a/Sources/Models/Questionnaire.swift +++ b/Sources/Models/Questionnaire.swift @@ -2,7 +2,7 @@ // Questionnaire.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Questionnaire) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Questionnaire) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * A structured set of questions. - * - * A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped - * into coherent subsets, corresponding to the structure of the grouping of the underlying questions. - */ +A structured set of questions. + +A structured set of questions intended to guide the collection of answers. The questions are ordered and grouped into +coherent subsets, corresponding to the structure of the grouping of the underlying questions. +*/ open class Questionnaire: DomainResource { override open class var resourceType: String { get { return "Questionnaire" } @@ -35,8 +35,8 @@ open class Questionnaire: DomainResource { /// Organization/individual who designed the questionnaire. public var publisher: String? - /// draft | published | retired. - public var status: String? + /// The lifecycle status of the questionnaire as a whole. + public var status: QuestionnaireStatus? /// Resource that can be subject of QuestionnaireResponse. public var subjectType: [String]? @@ -58,7 +58,7 @@ open class Questionnaire: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: QuestionnaireStatus) { self.init() self.status = status } @@ -129,7 +129,12 @@ open class Questionnaire: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = QuestionnaireStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -224,14 +229,10 @@ open class Questionnaire: DomainResource { json["publisher"] = publisher.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subjectType = self.subjectType { - var arr = [Any]() - for val in subjectType { - arr.append(val.asJSON()) - } - json["subjectType"] = arr + json["subjectType"] = subjectType.map() { $0.asJSON() } } if let telecom = self.telecom { json["telecom"] = telecom.map() { $0.asJSON(errors: &errors) } @@ -255,10 +256,10 @@ open class Questionnaire: DomainResource { /** - * Questions and sections within the Questionnaire. - * - * The questions and groupings of questions that make up the questionnaire. - */ +Questions and sections within the Questionnaire. + +The questions and groupings of questions that make up the questionnaire. +*/ open class QuestionnaireItem: BackboneElement { override open class var resourceType: String { get { return "QuestionnaireItem" } @@ -339,12 +340,13 @@ open class QuestionnaireItem: BackboneElement { /// Primary text for the item. public var text: String? - /// group | display | question | boolean | decimal | integer | date | dateTime +. - public var type: String? + /// Identifies the type of questionnaire item this is - whether text for display, a grouping of other items or a + /// particular type of data to be captured (string, integer, coded choice, etc.). + public var type: QuestionnaireItemType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(type: String) { + public convenience init(type: QuestionnaireItemType) { self.init() self.type = type } @@ -625,7 +627,12 @@ open class QuestionnaireItem: BackboneElement { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = QuestionnaireItemType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -716,7 +723,7 @@ open class QuestionnaireItem: BackboneElement { json["text"] = text.asJSON() } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json @@ -725,11 +732,11 @@ open class QuestionnaireItem: BackboneElement { /** - * Only allow data when:. - * - * If present, indicates that this item should only be enabled (displayed/allow answers to be captured) when the - * specified condition is true. - */ +Only allow data when:. + +If present, indicates that this item should only be enabled (displayed/allow answers to be captured) when the specified +condition is true. +*/ open class QuestionnaireItemEnableWhen: BackboneElement { override open class var resourceType: String { get { return "QuestionnaireItemEnableWhen" } @@ -1006,10 +1013,10 @@ open class QuestionnaireItemEnableWhen: BackboneElement { /** - * Permitted answer. - * - * For a "choice" question, identifies one of the permitted answers for the question. - */ +Permitted answer. + +For a "choice" question, identifies one of the permitted answers for the question. +*/ open class QuestionnaireItemOption: BackboneElement { override open class var resourceType: String { get { return "QuestionnaireItemOption" } diff --git a/Sources/Models/QuestionnaireResponse.swift b/Sources/Models/QuestionnaireResponse.swift index 1aac47b9..3d49fcb2 100644 --- a/Sources/Models/QuestionnaireResponse.swift +++ b/Sources/Models/QuestionnaireResponse.swift @@ -2,7 +2,7 @@ // QuestionnaireResponse.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/QuestionnaireResponse) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * A structured set of questions and their answers. - * - * A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, - * corresponding to the structure of the grouping of the underlying questions. - */ +A structured set of questions and their answers. + +A structured set of questions and their answers. The questions are ordered and grouped into coherent subsets, +corresponding to the structure of the grouping of the underlying questions. +*/ open class QuestionnaireResponse: DomainResource { override open class var resourceType: String { get { return "QuestionnaireResponse" } @@ -47,15 +47,15 @@ open class QuestionnaireResponse: DomainResource { /// The person who answered the questions. public var source: Reference? - /// in-progress | completed | amended | entered-in-error. - public var status: String? + /// The lifecycle status of the questionnaire response as a whole. + public var status: QuestionnaireResponseStatus? /// The subject of the questions. public var subject: Reference? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: QuestionnaireResponseStatus) { self.init() self.status = status } @@ -187,7 +187,12 @@ open class QuestionnaireResponse: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = QuestionnaireResponseStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -244,7 +249,7 @@ open class QuestionnaireResponse: DomainResource { json["source"] = source.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) @@ -256,10 +261,10 @@ open class QuestionnaireResponse: DomainResource { /** - * Groups and questions. - * - * Corresponds to a group or question item from the original questionnaire. - */ +Groups and questions. + +Corresponds to a group or question item from the original questionnaire. +*/ open class QuestionnaireResponseItem: BackboneElement { override open class var resourceType: String { get { return "QuestionnaireResponseItem" } @@ -371,10 +376,10 @@ open class QuestionnaireResponseItem: BackboneElement { /** - * The response(s) to the question. - * - * The respondent's answer(s) to the question. - */ +The response(s) to the question. + +The respondent's answer(s) to the question. +*/ open class QuestionnaireResponseItemAnswer: BackboneElement { override open class var resourceType: String { get { return "QuestionnaireResponseItemAnswer" } diff --git a/Sources/Models/Range.swift b/Sources/Models/Range.swift index 054860b7..c7d9f59c 100644 --- a/Sources/Models/Range.swift +++ b/Sources/Models/Range.swift @@ -2,7 +2,7 @@ // Range.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Range) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Range) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Set of values bounded by low and high. - * - * A set of ordered Quantities defined by a low and high limit. - */ +Set of values bounded by low and high. + +A set of ordered Quantities defined by a low and high limit. +*/ open class Range: Element { override open class var resourceType: String { get { return "Range" } diff --git a/Sources/Models/Ratio.swift b/Sources/Models/Ratio.swift index 74f722d9..b0f0466c 100644 --- a/Sources/Models/Ratio.swift +++ b/Sources/Models/Ratio.swift @@ -2,7 +2,7 @@ // Ratio.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Ratio) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Ratio) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * A ratio of two Quantity values - a numerator and a denominator. - * - * A relationship of two Quantity values - expressed as a numerator and a denominator. - */ +A ratio of two Quantity values - a numerator and a denominator. + +A relationship of two Quantity values - expressed as a numerator and a denominator. +*/ open class Ratio: Element { override open class var resourceType: String { get { return "Ratio" } diff --git a/Sources/Models/Reference.swift b/Sources/Models/Reference.swift index 7c9d0ae6..7abd3fe7 100644 --- a/Sources/Models/Reference.swift +++ b/Sources/Models/Reference.swift @@ -2,7 +2,7 @@ // Reference.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Reference) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Reference) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,8 +10,8 @@ import Foundation /** - * A reference from one resource to another. - */ +A reference from one resource to another. +*/ open class Reference: Element { override open class var resourceType: String { get { return "Reference" } diff --git a/Sources/Models/ReferralRequest.swift b/Sources/Models/ReferralRequest.swift index 23b37749..866fd9ad 100644 --- a/Sources/Models/ReferralRequest.swift +++ b/Sources/Models/ReferralRequest.swift @@ -2,7 +2,7 @@ // ReferralRequest.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ReferralRequest) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ReferralRequest) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * A request for referral or transfer of care. - * - * Used to record and send details about a request for referral service or transfer of a patient to the care of another - * provider or provider organization. - */ +A request for referral or transfer of care. + +Used to record and send details about a request for referral service or transfer of a patient to the care of another +provider or provider organization. +*/ open class ReferralRequest: DomainResource { override open class var resourceType: String { get { return "ReferralRequest" } @@ -26,8 +26,8 @@ open class ReferralRequest: DomainResource { /// Request fulfilled by this request. public var basedOn: [Reference]? - /// proposal | plan | request. - public var category: String? + /// Distinguishes the "level" of authorization/demand implicit in this request. + public var category: ReferralCategory? /// Originating encounter. public var context: Reference? @@ -65,8 +65,8 @@ open class ReferralRequest: DomainResource { /// The clinical specialty (discipline) that the referral is requested for. public var specialty: CodeableConcept? - /// draft | active | cancelled | completed | entered-in-error. - public var status: String? + /// The status of the authorization/intention reflected by the referral request record. + public var status: ReferralStatus? /// Additonal information to support referral or transfer of care request. public var supportingInformation: [Reference]? @@ -76,7 +76,7 @@ open class ReferralRequest: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(category: String, status: String) { + public convenience init(category: ReferralCategory, status: ReferralStatus) { self.init() self.category = category self.status = status @@ -111,7 +111,12 @@ open class ReferralRequest: DomainResource { if let exist = json["category"] { presentKeys.insert("category") if let val = exist as? String { - self.category = val + if let enumval = ReferralCategory(rawValue: val) { + self.category = enumval + } + else { + errors.append(FHIRValidationError(key: "category", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "category", wants: String.self, has: type(of: exist))) @@ -286,7 +291,12 @@ open class ReferralRequest: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = ReferralStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -336,7 +346,7 @@ open class ReferralRequest: DomainResource { json["basedOn"] = basedOn.map() { $0.asJSON(errors: &errors) } } if let category = self.category { - json["category"] = category.asJSON() + json["category"] = category.rawValue } if let context = self.context { json["context"] = context.asJSON(errors: &errors) @@ -375,7 +385,7 @@ open class ReferralRequest: DomainResource { json["specialty"] = specialty.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let supportingInformation = self.supportingInformation { json["supportingInformation"] = supportingInformation.map() { $0.asJSON(errors: &errors) } diff --git a/Sources/Models/RelatedArtifact.swift b/Sources/Models/RelatedArtifact.swift index 5a8940b0..f7f5bc46 100644 --- a/Sources/Models/RelatedArtifact.swift +++ b/Sources/Models/RelatedArtifact.swift @@ -2,7 +2,7 @@ // RelatedArtifact.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/RelatedArtifact) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/RelatedArtifact) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Related artifacts for a knowledge resource. - * - * Related artifacts such as additional documentation, justification, or bibliographic references. - */ +Related artifacts for a knowledge resource. + +Related artifacts such as additional documentation, justification, or bibliographic references. +*/ open class RelatedArtifact: Element { override open class var resourceType: String { get { return "RelatedArtifact" } @@ -31,15 +31,15 @@ open class RelatedArtifact: Element { /// The related resource. public var resource: Reference? - /// documentation | justification | citation | predecessor | successor | derived-from | depends-on | composed-of. - public var type: String? + /// The type of relationship to the related artifact. + public var type: RelatedArtifactType? /// Url for the related artifact. public var url: URL? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(type: String) { + public convenience init(type: RelatedArtifactType) { self.init() self.type = type } @@ -96,7 +96,12 @@ open class RelatedArtifact: Element { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = RelatedArtifactType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -133,7 +138,7 @@ open class RelatedArtifact: Element { json["resource"] = resource.asJSON(errors: &errors) } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } if let url = self.url { json["url"] = url.asJSON() diff --git a/Sources/Models/RelatedPerson.swift b/Sources/Models/RelatedPerson.swift index c8d57672..4b057e85 100644 --- a/Sources/Models/RelatedPerson.swift +++ b/Sources/Models/RelatedPerson.swift @@ -2,7 +2,7 @@ // RelatedPerson.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/RelatedPerson) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/RelatedPerson) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * An person that is related to a patient, but who is not a direct target of care. - * - * Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor - * has a formal responsibility in the care process. - */ +An person that is related to a patient, but who is not a direct target of care. + +Information about a person that is involved in the care for a patient, but who is not the target of healthcare, nor has +a formal responsibility in the care process. +*/ open class RelatedPerson: DomainResource { override open class var resourceType: String { get { return "RelatedPerson" } @@ -29,8 +29,9 @@ open class RelatedPerson: DomainResource { /// The date on which the related person was born. public var birthDate: FHIRDate? - /// male | female | other | unknown. - public var gender: String? + /// Administrative Gender - the gender that the person is considered to have for administration and record keeping + /// purposes. + public var gender: AdministrativeGender? /// A human identifier for this person. public var identifier: [Identifier]? @@ -98,7 +99,12 @@ open class RelatedPerson: DomainResource { if let exist = json["gender"] { presentKeys.insert("gender") if let val = exist as? String { - self.gender = val + if let enumval = AdministrativeGender(rawValue: val) { + self.gender = enumval + } + else { + errors.append(FHIRValidationError(key: "gender", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "gender", wants: String.self, has: type(of: exist))) @@ -221,7 +227,7 @@ open class RelatedPerson: DomainResource { json["birthDate"] = birthDate.asJSON() } if let gender = self.gender { - json["gender"] = gender.asJSON() + json["gender"] = gender.rawValue } if let identifier = self.identifier { json["identifier"] = identifier.map() { $0.asJSON(errors: &errors) } diff --git a/Sources/Models/RequestGroup.swift b/Sources/Models/RequestGroup.swift index 11135dcd..c4e969c4 100644 --- a/Sources/Models/RequestGroup.swift +++ b/Sources/Models/RequestGroup.swift @@ -2,7 +2,7 @@ // RequestGroup.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/RequestGroup) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/RequestGroup) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * A group of related requests. - * - * A group of related requests that can be used to capture intended activities that have inter-dependencies such as - * "give this medication after that one". - */ +A group of related requests. + +A group of related requests that can be used to capture intended activities that have inter-dependencies such as "give +this medication after that one". +*/ open class RequestGroup: DomainResource { override open class var resourceType: String { get { return "RequestGroup" } @@ -211,10 +211,10 @@ open class RequestGroup: DomainResource { /** - * Proposed actions, if any. - * - * The actions, if any, produced by the evaluation of the artifact. - */ +Proposed actions, if any. + +The actions, if any, produced by the evaluation of the artifact. +*/ open class RequestGroupAction: BackboneElement { override open class var resourceType: String { get { return "RequestGroupAction" } @@ -226,8 +226,8 @@ open class RequestGroupAction: BackboneElement { /// Unique identifier. public var actionIdentifier: Identifier? - /// single | multiple. - public var cardinalityBehavior: String? + /// Defines whether the action can be selected multiple times. + public var cardinalityBehavior: PlanActionCardinalityBehavior? /// The meaning of the action or its sub-actions. public var code: [CodeableConcept]? @@ -238,8 +238,8 @@ open class RequestGroupAction: BackboneElement { /// Supporting documentation for the intended performer of the action. public var documentation: [RelatedArtifact]? - /// visual-group | logical-group | sentence-group. - public var groupingBehavior: String? + /// Defines the grouping behavior for the action and its children. + public var groupingBehavior: PlanActionGroupingBehavior? /// User-visible label for the action (e.g. 1. or A.). public var label: String? @@ -247,20 +247,20 @@ open class RequestGroupAction: BackboneElement { /// Participant. public var participant: [Reference]? - /// yes | no. - public var precheckBehavior: String? + /// Defines whether the action should usually be preselected. + public var precheckBehavior: PlanActionPrecheckBehavior? /// Relationship to another action. public var relatedAction: RequestGroupActionRelatedAction? - /// must | could | must-unless-documented. - public var requiredBehavior: String? + /// Defines the requiredness behavior for the action. + public var requiredBehavior: PlanActionRequiredBehavior? /// The target of the action. public var resource: Reference? - /// any | all | all-or-none | exactly-one | at-most-one | one-or-more. - public var selectionBehavior: String? + /// Defines the selection behavior for the action and its children. + public var selectionBehavior: PlanActionSelectionBehavior? /// Static text equivalent of the action, used if the dynamic aspects cannot be interpreted by the receiving system. public var textEquivalent: String? @@ -317,7 +317,12 @@ open class RequestGroupAction: BackboneElement { if let exist = json["cardinalityBehavior"] { presentKeys.insert("cardinalityBehavior") if let val = exist as? String { - self.cardinalityBehavior = val + if let enumval = PlanActionCardinalityBehavior(rawValue: val) { + self.cardinalityBehavior = enumval + } + else { + errors.append(FHIRValidationError(key: "cardinalityBehavior", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "cardinalityBehavior", wants: String.self, has: type(of: exist))) @@ -363,7 +368,12 @@ open class RequestGroupAction: BackboneElement { if let exist = json["groupingBehavior"] { presentKeys.insert("groupingBehavior") if let val = exist as? String { - self.groupingBehavior = val + if let enumval = PlanActionGroupingBehavior(rawValue: val) { + self.groupingBehavior = enumval + } + else { + errors.append(FHIRValidationError(key: "groupingBehavior", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "groupingBehavior", wants: String.self, has: type(of: exist))) @@ -395,7 +405,12 @@ open class RequestGroupAction: BackboneElement { if let exist = json["precheckBehavior"] { presentKeys.insert("precheckBehavior") if let val = exist as? String { - self.precheckBehavior = val + if let enumval = PlanActionPrecheckBehavior(rawValue: val) { + self.precheckBehavior = enumval + } + else { + errors.append(FHIRValidationError(key: "precheckBehavior", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "precheckBehavior", wants: String.self, has: type(of: exist))) @@ -418,7 +433,12 @@ open class RequestGroupAction: BackboneElement { if let exist = json["requiredBehavior"] { presentKeys.insert("requiredBehavior") if let val = exist as? String { - self.requiredBehavior = val + if let enumval = PlanActionRequiredBehavior(rawValue: val) { + self.requiredBehavior = enumval + } + else { + errors.append(FHIRValidationError(key: "requiredBehavior", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "requiredBehavior", wants: String.self, has: type(of: exist))) @@ -441,7 +461,12 @@ open class RequestGroupAction: BackboneElement { if let exist = json["selectionBehavior"] { presentKeys.insert("selectionBehavior") if let val = exist as? String { - self.selectionBehavior = val + if let enumval = PlanActionSelectionBehavior(rawValue: val) { + self.selectionBehavior = enumval + } + else { + errors.append(FHIRValidationError(key: "selectionBehavior", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "selectionBehavior", wants: String.self, has: type(of: exist))) @@ -543,7 +568,7 @@ open class RequestGroupAction: BackboneElement { json["actionIdentifier"] = actionIdentifier.asJSON(errors: &errors) } if let cardinalityBehavior = self.cardinalityBehavior { - json["cardinalityBehavior"] = cardinalityBehavior.asJSON() + json["cardinalityBehavior"] = cardinalityBehavior.rawValue } if let code = self.code { json["code"] = code.map() { $0.asJSON(errors: &errors) } @@ -555,7 +580,7 @@ open class RequestGroupAction: BackboneElement { json["documentation"] = documentation.map() { $0.asJSON(errors: &errors) } } if let groupingBehavior = self.groupingBehavior { - json["groupingBehavior"] = groupingBehavior.asJSON() + json["groupingBehavior"] = groupingBehavior.rawValue } if let label = self.label { json["label"] = label.asJSON() @@ -564,19 +589,19 @@ open class RequestGroupAction: BackboneElement { json["participant"] = participant.map() { $0.asJSON(errors: &errors) } } if let precheckBehavior = self.precheckBehavior { - json["precheckBehavior"] = precheckBehavior.asJSON() + json["precheckBehavior"] = precheckBehavior.rawValue } if let relatedAction = self.relatedAction { json["relatedAction"] = relatedAction.asJSON(errors: &errors) } if let requiredBehavior = self.requiredBehavior { - json["requiredBehavior"] = requiredBehavior.asJSON() + json["requiredBehavior"] = requiredBehavior.rawValue } if let resource = self.resource { json["resource"] = resource.asJSON(errors: &errors) } if let selectionBehavior = self.selectionBehavior { - json["selectionBehavior"] = selectionBehavior.asJSON() + json["selectionBehavior"] = selectionBehavior.rawValue } if let textEquivalent = self.textEquivalent { json["textEquivalent"] = textEquivalent.asJSON() @@ -606,10 +631,10 @@ open class RequestGroupAction: BackboneElement { /** - * Relationship to another action. - * - * A relationship to another action such as "before" or "30-60 minutes after start of". - */ +Relationship to another action. + +A relationship to another action such as "before" or "30-60 minutes after start of". +*/ open class RequestGroupActionRelatedAction: BackboneElement { override open class var resourceType: String { get { return "RequestGroupActionRelatedAction" } @@ -624,12 +649,12 @@ open class RequestGroupActionRelatedAction: BackboneElement { /// Time offset for the relationship. public var offsetRange: Range? - /// before-start | before | before-end | concurrent-with-start | concurrent | concurrent-with-end | after-start | after | after-end. - public var relationship: String? + /// The relationship of this action to the related action. + public var relationship: PlanActionRelationshipType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(actionIdentifier: Identifier, relationship: String) { + public convenience init(actionIdentifier: Identifier, relationship: PlanActionRelationshipType) { self.init() self.actionIdentifier = actionIdentifier self.relationship = relationship @@ -686,7 +711,12 @@ open class RequestGroupActionRelatedAction: BackboneElement { if let exist = json["relationship"] { presentKeys.insert("relationship") if let val = exist as? String { - self.relationship = val + if let enumval = PlanActionRelationshipType(rawValue: val) { + self.relationship = enumval + } + else { + errors.append(FHIRValidationError(key: "relationship", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "relationship", wants: String.self, has: type(of: exist))) @@ -711,7 +741,7 @@ open class RequestGroupActionRelatedAction: BackboneElement { json["offsetRange"] = offsetRange.asJSON(errors: &errors) } if let relationship = self.relationship { - json["relationship"] = relationship.asJSON() + json["relationship"] = relationship.rawValue } return json diff --git a/Sources/Models/Resource.swift b/Sources/Models/Resource.swift index f18bf950..e4db817c 100644 --- a/Sources/Models/Resource.swift +++ b/Sources/Models/Resource.swift @@ -2,7 +2,7 @@ // Resource.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Resource) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Resource) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Base Resource. - * - * This is the base resource type for everything. - */ +Base Resource. + +This is the base resource type for everything. +*/ open class Resource: FHIRAbstractResource { override open class var resourceType: String { get { return "Resource" } diff --git a/Sources/Models/RiskAssessment.swift b/Sources/Models/RiskAssessment.swift index abbb4c4e..f0a8bd95 100644 --- a/Sources/Models/RiskAssessment.swift +++ b/Sources/Models/RiskAssessment.swift @@ -2,7 +2,7 @@ // RiskAssessment.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/RiskAssessment) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/RiskAssessment) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Potential outcomes for a subject with likelihood. - * - * An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. - */ +Potential outcomes for a subject with likelihood. + +An assessment of the likely outcome(s) for a patient or other subject as well as the likelihood of each outcome. +*/ open class RiskAssessment: DomainResource { override open class var resourceType: String { get { return "RiskAssessment" } @@ -67,15 +67,15 @@ open class RiskAssessment: DomainResource { /// Why the assessment was necessary?. public var reasonReference: Reference? - /// registered | preliminary | final | amended +. - public var status: String? + /// The status of the RiskAssessment, using the same statuses as an Observation. + public var status: ObservationStatus? /// Who/what does assessment apply to?. public var subject: Reference? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: ObservationStatus) { self.init() self.status = status } @@ -300,7 +300,12 @@ open class RiskAssessment: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = ObservationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -378,7 +383,7 @@ open class RiskAssessment: DomainResource { json["reasonReference"] = reasonReference.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) @@ -390,10 +395,10 @@ open class RiskAssessment: DomainResource { /** - * Outcome predicted. - * - * Describes the expected outcome for the subject. - */ +Outcome predicted. + +Describes the expected outcome for the subject. +*/ open class RiskAssessmentPrediction: BackboneElement { override open class var resourceType: String { get { return "RiskAssessmentPrediction" } diff --git a/Sources/Models/SampledData.swift b/Sources/Models/SampledData.swift index 8cfd7579..b36f26d4 100644 --- a/Sources/Models/SampledData.swift +++ b/Sources/Models/SampledData.swift @@ -2,7 +2,7 @@ // SampledData.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/SampledData) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/SampledData) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * A series of measurements taken by a device. - * - * A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the - * data. - */ +A series of measurements taken by a device. + +A series of measurements taken by a device, with upper and lower limits. There may be more than one dimension in the +data. +*/ open class SampledData: Element { override open class var resourceType: String { get { return "SampledData" } diff --git a/Sources/Models/Schedule.swift b/Sources/Models/Schedule.swift index e3e11905..b7c5de6d 100644 --- a/Sources/Models/Schedule.swift +++ b/Sources/Models/Schedule.swift @@ -2,7 +2,7 @@ // Schedule.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Schedule) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Schedule) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,8 +10,8 @@ import Foundation /** - * A container for slot(s) of time that may be available for booking appointments. - */ +A container for slot(s) of time that may be available for booking appointments. +*/ open class Schedule: DomainResource { override open class var resourceType: String { get { return "Schedule" } @@ -20,16 +20,20 @@ open class Schedule: DomainResource { /// Whether this schedule is in active use. public var active: Bool? - /// The resource this Schedule resource is providing availability information for. These are expected to usually be one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson. + /// The resource this Schedule resource is providing availability information for. These are expected to usually be + /// one of HealthcareService, Location, Practitioner, Device, Patient or RelatedPerson. public var actor: Reference? - /// Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) that may be associated. + /// Comments on the availability to describe any extended information. Such as custom constraints on the slot(s) + /// that may be associated. public var comment: String? /// External Ids for this item. public var identifier: [Identifier]? - /// The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These cover the amount of time that an organization's planning horizon; the interval for which they are currently accepting appointments. This does not define a "template" for planning outside these dates. + /// The period of time that the slots that are attached to this Schedule resource cover (even if none exist). These + /// cover the amount of time that an organization's planning horizon; the interval for which they are currently + /// accepting appointments. This does not define a "template" for planning outside these dates. public var planningHorizon: Period? /// A broad categorisation of the service that is to be performed during this appointment. diff --git a/Sources/Models/SearchParameter.swift b/Sources/Models/SearchParameter.swift index 1b39ab70..9638d0bc 100644 --- a/Sources/Models/SearchParameter.swift +++ b/Sources/Models/SearchParameter.swift @@ -2,7 +2,7 @@ // SearchParameter.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/SearchParameter) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/SearchParameter) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Search Parameter for a resource. - * - * A search parameter that defines a named search item that can be used to search/filter on a resource. - */ +Search Parameter for a resource. + +A search parameter that defines a named search item that can be used to search/filter on a resource. +*/ open class SearchParameter: DomainResource { override open class var resourceType: String { get { return "SearchParameter" } @@ -55,14 +55,14 @@ open class SearchParameter: DomainResource { /// Why this search parameter is defined. public var purpose: String? - /// draft | active | retired. - public var status: String? + /// The status of this search parameter. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Types of resource (if a resource reference). public var target: [String]? - /// number | date | string | token | reference | composite | quantity | uri. - public var type: String? + /// The type of value a search parameter refers to, and how the content is interpreted. + public var type: SearchParamType? /// Logical uri to reference this search parameter (globally unique). public var url: URL? @@ -76,12 +76,12 @@ open class SearchParameter: DomainResource { /// XPath that extracts the values. public var xpath: String? - /// normal | phonetic | nearby | distance | other. - public var xpathUsage: String? + /// How the search parameter relates to the set of elements returned by evaluating the xpath query. + public var xpathUsage: XPathUsageType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(base: String, code: String, description_fhir: String, name: String, status: String, type: String, url: URL) { + public convenience init(base: String, code: String, description_fhir: String, name: String, status: PublicationStatus, type: SearchParamType, url: URL) { self.init() self.base = base self.code = code @@ -233,7 +233,12 @@ open class SearchParameter: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -254,7 +259,12 @@ open class SearchParameter: DomainResource { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = SearchParamType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -310,7 +320,12 @@ open class SearchParameter: DomainResource { if let exist = json["xpathUsage"] { presentKeys.insert("xpathUsage") if let val = exist as? String { - self.xpathUsage = val + if let enumval = XPathUsageType(rawValue: val) { + self.xpathUsage = enumval + } + else { + errors.append(FHIRValidationError(key: "xpathUsage", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "xpathUsage", wants: String.self, has: type(of: exist))) @@ -359,17 +374,13 @@ open class SearchParameter: DomainResource { json["purpose"] = purpose.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let target = self.target { - var arr = [Any]() - for val in target { - arr.append(val.asJSON()) - } - json["target"] = arr + json["target"] = target.map() { $0.asJSON() } } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } if let url = self.url { json["url"] = url.asJSON() @@ -384,7 +395,7 @@ open class SearchParameter: DomainResource { json["xpath"] = xpath.asJSON() } if let xpathUsage = self.xpathUsage { - json["xpathUsage"] = xpathUsage.asJSON() + json["xpathUsage"] = xpathUsage.rawValue } return json diff --git a/Sources/Models/Sequence.swift b/Sources/Models/Sequence.swift index 28ea54c1..bda807ab 100644 --- a/Sources/Models/Sequence.swift +++ b/Sources/Models/Sequence.swift @@ -2,7 +2,7 @@ // Sequence.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Sequence) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Sequence) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Information about a biological sequence. - * - * Raw data describing a biological sequence. - */ +Information about a biological sequence. + +Raw data describing a biological sequence. +*/ open class Sequence: DomainResource { override open class var resourceType: String { get { return "Sequence" } @@ -329,11 +329,11 @@ open class Sequence: DomainResource { /** - * Sequence quality. - * - * An experimental feature attribute that defines the quality of the feature in a quantitative way, such as a phred - * quality score ([SO:0001686](http://www.sequenceontology.org/browser/current_svn/term/SO:0001686)). - */ +Sequence quality. + +An experimental feature attribute that defines the quality of the feature in a quantitative way, such as a phred quality +score ([SO:0001686](http://www.sequenceontology.org/browser/current_svn/term/SO:0001686)). +*/ open class SequenceQuality: BackboneElement { override open class var resourceType: String { get { return "SequenceQuality" } @@ -565,10 +565,10 @@ open class SequenceQuality: BackboneElement { /** - * Reference sequence. - * - * A reference sequence is a sequence that is used to represent an allele or variant. - */ +Reference sequence. + +A reference sequence is a sequence that is used to represent an allele or variant. +*/ open class SequenceReferenceSeq: BackboneElement { override open class var resourceType: String { get { return "SequenceReferenceSeq" } @@ -747,10 +747,10 @@ open class SequenceReferenceSeq: BackboneElement { /** - * External repository. - * - * Configurations of the external repository. - */ +External repository. + +Configurations of the external repository. +*/ open class SequenceRepository: BackboneElement { override open class var resourceType: String { get { return "SequenceRepository" } @@ -832,8 +832,8 @@ open class SequenceRepository: BackboneElement { /** - * Structural variant. - */ +Structural variant. +*/ open class SequenceStructureVariant: BackboneElement { override open class var resourceType: String { get { return "SequenceStructureVariant" } @@ -940,8 +940,8 @@ open class SequenceStructureVariant: BackboneElement { /** - * Structural variant inner. - */ +Structural variant inner. +*/ open class SequenceStructureVariantInner: BackboneElement { override open class var resourceType: String { get { return "SequenceStructureVariantInner" } @@ -993,8 +993,8 @@ open class SequenceStructureVariantInner: BackboneElement { /** - * Structural variant outer. - */ +Structural variant outer. +*/ open class SequenceStructureVariantOuter: BackboneElement { override open class var resourceType: String { get { return "SequenceStructureVariantOuter" } @@ -1046,12 +1046,12 @@ open class SequenceStructureVariantOuter: BackboneElement { /** - * Sequence variant. - * - * A' is a variant (mutation) of A = definition every instance of A' is either an immediate mutation of some instance - * of A, or there is a chain of immediate mutation processes linking A' to some instance of A - * ([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). - */ +Sequence variant. + +A' is a variant (mutation) of A = definition every instance of A' is either an immediate mutation of some instance of A, +or there is a chain of immediate mutation processes linking A' to some instance of A +([variant_of](http://www.sequenceontology.org/browser/current_svn/term/variant_of)). +*/ open class SequenceVariant: BackboneElement { override open class var resourceType: String { get { return "SequenceVariant" } diff --git a/Sources/Models/ServiceDefinition.swift b/Sources/Models/ServiceDefinition.swift index 28c67a48..72e5e70c 100644 --- a/Sources/Models/ServiceDefinition.swift +++ b/Sources/Models/ServiceDefinition.swift @@ -2,7 +2,7 @@ // ServiceDefinition.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ServiceDefinition) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ServiceDefinition) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * A description of decision support service functionality. - * - * The ServiceDefinition describes a unit of decision support functionality that is made available as a service, such - * as immunization modules or drug-drug interaction checking. - */ +A description of decision support service functionality. + +The ServiceDefinition describes a unit of decision support functionality that is made available as a service, such as +immunization modules or drug-drug interaction checking. +*/ open class ServiceDefinition: DomainResource { override open class var resourceType: String { get { return "ServiceDefinition" } @@ -71,8 +71,8 @@ open class ServiceDefinition: DomainResource { /// Related resources for the module. public var relatedArtifact: [RelatedArtifact]? - /// draft | active | retired. - public var status: String? + /// The status of this service definition. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Name for this service definition (Human friendly). public var title: String? @@ -97,7 +97,7 @@ open class ServiceDefinition: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: PublicationStatus) { self.init() self.status = status } @@ -301,7 +301,12 @@ open class ServiceDefinition: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -446,7 +451,7 @@ open class ServiceDefinition: DomainResource { json["relatedArtifact"] = relatedArtifact.map() { $0.asJSON(errors: &errors) } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let title = self.title { json["title"] = title.asJSON() diff --git a/Sources/Models/Signature.swift b/Sources/Models/Signature.swift index 9a5b009b..a0ca8d35 100644 --- a/Sources/Models/Signature.swift +++ b/Sources/Models/Signature.swift @@ -2,7 +2,7 @@ // Signature.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Signature) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Signature) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,12 +10,12 @@ import Foundation /** - * A digital Signature - XML DigSig, JWT, Graphical image of signature, etc.. - * - * A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a - * graphical image representing a hand-written signature, or a signature process. Different Signature approaches have - * different utilities. - */ +A digital Signature - XML DigSig, JWT, Graphical image of signature, etc.. + +A digital signature along with supporting context. The signature may be electronic/cryptographic in nature, or a +graphical image representing a hand-written signature, or a signature process. Different Signature approaches have +different utilities. +*/ open class Signature: Element { override open class var resourceType: String { get { return "Signature" } diff --git a/Sources/Models/Slot.swift b/Sources/Models/Slot.swift index c1207779..d0a6ad72 100644 --- a/Sources/Models/Slot.swift +++ b/Sources/Models/Slot.swift @@ -2,7 +2,7 @@ // Slot.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Slot) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Slot) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,8 +10,8 @@ import Foundation /** - * A slot of time on a schedule that may be available for booking appointments. - */ +A slot of time on a schedule that may be available for booking appointments. +*/ open class Slot: DomainResource { override open class var resourceType: String { get { return "Slot" } @@ -38,7 +38,9 @@ open class Slot: DomainResource { /// A broad categorisation of the service that is to be performed during this appointment. public var serviceCategory: CodeableConcept? - /// The type of appointments that can be booked into this slot (ideally this would be an identifiable service - which is at a location, rather than the location itself). If provided then this overrides the value provided on the availability resource. + /// The type of appointments that can be booked into this slot (ideally this would be an identifiable service - + /// which is at a location, rather than the location itself). If provided then this overrides the value provided on + /// the availability resource. public var serviceType: [CodeableConcept]? /// The specialty of a practitioner that would be required to perform the service requested in this appointment. @@ -47,12 +49,12 @@ open class Slot: DomainResource { /// Date/Time that the slot is to begin. public var start: Instant? - /// busy | free | busy-unavailable | busy-tentative | entered-in-error. - public var status: String? + /// None + public var status: SlotStatus? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(end: Instant, schedule: Reference, start: Instant, status: String) { + public convenience init(end: Instant, schedule: Reference, start: Instant, status: SlotStatus) { self.init() self.end = end self.schedule = schedule @@ -195,7 +197,12 @@ open class Slot: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = SlotStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -241,7 +248,7 @@ open class Slot: DomainResource { json["start"] = start.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } return json diff --git a/Sources/Models/Specimen.swift b/Sources/Models/Specimen.swift index e398c451..b948f5e3 100644 --- a/Sources/Models/Specimen.swift +++ b/Sources/Models/Specimen.swift @@ -2,7 +2,7 @@ // Specimen.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Specimen) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Specimen) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Sample for analysis. - * - * A sample to be used for analysis. - */ +Sample for analysis. + +A sample to be used for analysis. +*/ open class Specimen: DomainResource { override open class var resourceType: String { get { return "Specimen" } @@ -43,8 +43,8 @@ open class Specimen: DomainResource { /// Why the specimen was collected. public var request: [Reference]? - /// available | unavailable | unsatisfactory | entered-in-error. - public var status: String? + /// The availability of the specimen. + public var status: SpecimenStatus? /// Where the specimen came from. This may be from the patient(s) or from the environment or a device. public var subject: Reference? @@ -175,7 +175,12 @@ open class Specimen: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = SpecimenStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -257,7 +262,7 @@ open class Specimen: DomainResource { json["request"] = request.map() { $0.asJSON(errors: &errors) } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let subject = self.subject { json["subject"] = subject.asJSON(errors: &errors) @@ -275,10 +280,10 @@ open class Specimen: DomainResource { /** - * Collection details. - * - * Details concerning the specimen collection. - */ +Collection details. + +Details concerning the specimen collection. +*/ open class SpecimenCollection: BackboneElement { override open class var resourceType: String { get { return "SpecimenCollection" } @@ -415,11 +420,11 @@ open class SpecimenCollection: BackboneElement { /** - * Direct container of specimen (tube/slide, etc.). - * - * The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not - * addressed here. - */ +Direct container of specimen (tube/slide, etc.). + +The container holding the specimen. The recursive nature of containers; i.e. blood in tube in tray in rack is not +addressed here. +*/ open class SpecimenContainer: BackboneElement { override open class var resourceType: String { get { return "SpecimenContainer" } @@ -576,10 +581,10 @@ open class SpecimenContainer: BackboneElement { /** - * Treatment and processing step details. - * - * Details concerning treatment and processing steps for the specimen. - */ +Treatment and processing step details. + +Details concerning treatment and processing steps for the specimen. +*/ open class SpecimenTreatment: BackboneElement { override open class var resourceType: String { get { return "SpecimenTreatment" } diff --git a/Sources/Models/StructureDefinition.swift b/Sources/Models/StructureDefinition.swift index 71cf0383..1a0a0aef 100644 --- a/Sources/Models/StructureDefinition.swift +++ b/Sources/Models/StructureDefinition.swift @@ -2,7 +2,7 @@ // StructureDefinition.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/StructureDefinition) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/StructureDefinition) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Structural Definition. - * - * A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in - * FHIR, and also for describing extensions, and constraints on resources and data types. - */ +Structural Definition. + +A definition of a FHIR structure. This resource is used to describe the underlying resources, data types defined in +FHIR, and also for describing extensions, and constraints on resources and data types. +*/ open class StructureDefinition: DomainResource { override open class var resourceType: String { get { return "StructureDefinition" } @@ -35,8 +35,8 @@ open class StructureDefinition: DomainResource { /// FluentPath invariants - when the extension can be used. public var contextInvariant: [String]? - /// resource | datatype | extension. - public var contextType: String? + /// If this is an extension, Identifies the context within FHIR resources where the extension can be used. + public var contextType: ExtensionContext? /// Use and/or publishing restrictions. public var copyright: String? @@ -44,8 +44,8 @@ open class StructureDefinition: DomainResource { /// Date this was last changed. public var date: DateTime? - /// specialization | constraint - How relates to base definition. - public var derivation: String? + /// How the type relates to the baseDefinition. + public var derivation: TypeDerivationRule? /// Natural language description of the structure definition. public var description_fhir: String? @@ -68,8 +68,8 @@ open class StructureDefinition: DomainResource { /// Assist with indexing and finding. public var keyword: [Coding]? - /// primitive-type | complex-type | resource | logical. - public var kind: String? + /// Defines the kind of structure that this definition is describing. + public var kind: StructureDefinitionKind? /// External specification that the content is mapped to. public var mapping: [StructureDefinitionMapping]? @@ -86,8 +86,8 @@ open class StructureDefinition: DomainResource { /// Snapshot view of the structure. public var snapshot: StructureDefinitionSnapshot? - /// draft | active | retired. - public var status: String? + /// The status of this structure definition. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Name for this structure definition (Human friendly). public var title: String? @@ -106,7 +106,7 @@ open class StructureDefinition: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(abstract: Bool, kind: String, name: String, status: String, type: String, url: URL) { + public convenience init(abstract: Bool, kind: StructureDefinitionKind, name: String, status: PublicationStatus, type: String, url: URL) { self.init() self.abstract = abstract self.kind = kind @@ -175,7 +175,12 @@ open class StructureDefinition: DomainResource { if let exist = json["contextType"] { presentKeys.insert("contextType") if let val = exist as? String { - self.contextType = val + if let enumval = ExtensionContext(rawValue: val) { + self.contextType = enumval + } + else { + errors.append(FHIRValidationError(key: "contextType", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "contextType", wants: String.self, has: type(of: exist))) @@ -202,7 +207,12 @@ open class StructureDefinition: DomainResource { if let exist = json["derivation"] { presentKeys.insert("derivation") if let val = exist as? String { - self.derivation = val + if let enumval = TypeDerivationRule(rawValue: val) { + self.derivation = enumval + } + else { + errors.append(FHIRValidationError(key: "derivation", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "derivation", wants: String.self, has: type(of: exist))) @@ -294,7 +304,12 @@ open class StructureDefinition: DomainResource { if let exist = json["kind"] { presentKeys.insert("kind") if let val = exist as? String { - self.kind = val + if let enumval = StructureDefinitionKind(rawValue: val) { + self.kind = enumval + } + else { + errors.append(FHIRValidationError(key: "kind", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "kind", wants: String.self, has: type(of: exist))) @@ -364,7 +379,12 @@ open class StructureDefinition: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -445,21 +465,13 @@ open class StructureDefinition: DomainResource { json["contact"] = contact.map() { $0.asJSON(errors: &errors) } } if let context = self.context { - var arr = [Any]() - for val in context { - arr.append(val.asJSON()) - } - json["context"] = arr + json["context"] = context.map() { $0.asJSON() } } if let contextInvariant = self.contextInvariant { - var arr = [Any]() - for val in contextInvariant { - arr.append(val.asJSON()) - } - json["contextInvariant"] = arr + json["contextInvariant"] = contextInvariant.map() { $0.asJSON() } } if let contextType = self.contextType { - json["contextType"] = contextType.asJSON() + json["contextType"] = contextType.rawValue } if let copyright = self.copyright { json["copyright"] = copyright.asJSON() @@ -468,7 +480,7 @@ open class StructureDefinition: DomainResource { json["date"] = date.asJSON() } if let derivation = self.derivation { - json["derivation"] = derivation.asJSON() + json["derivation"] = derivation.rawValue } if let description_fhir = self.description_fhir { json["description"] = description_fhir.asJSON() @@ -492,7 +504,7 @@ open class StructureDefinition: DomainResource { json["keyword"] = keyword.map() { $0.asJSON(errors: &errors) } } if let kind = self.kind { - json["kind"] = kind.asJSON() + json["kind"] = kind.rawValue } if let mapping = self.mapping { json["mapping"] = mapping.map() { $0.asJSON(errors: &errors) } @@ -510,7 +522,7 @@ open class StructureDefinition: DomainResource { json["snapshot"] = snapshot.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let title = self.title { json["title"] = title.asJSON() @@ -534,11 +546,10 @@ open class StructureDefinition: DomainResource { /** - * Differential view of the structure. - * - * A differential view is expressed relative to the base StructureDefinition - a statement of differences that it - * applies. - */ +Differential view of the structure. + +A differential view is expressed relative to the base StructureDefinition - a statement of differences that it applies. +*/ open class StructureDefinitionDifferential: BackboneElement { override open class var resourceType: String { get { return "StructureDefinitionDifferential" } @@ -590,10 +601,10 @@ open class StructureDefinitionDifferential: BackboneElement { /** - * External specification that the content is mapped to. - * - * An external specification that the content is mapped to. - */ +External specification that the content is mapped to. + +An external specification that the content is mapped to. +*/ open class StructureDefinitionMapping: BackboneElement { override open class var resourceType: String { get { return "StructureDefinitionMapping" } @@ -685,11 +696,11 @@ open class StructureDefinitionMapping: BackboneElement { /** - * Snapshot view of the structure. - * - * A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base - * StructureDefinition. - */ +Snapshot view of the structure. + +A snapshot view is expressed in a stand alone form that can be used and interpreted without considering the base +StructureDefinition. +*/ open class StructureDefinitionSnapshot: BackboneElement { override open class var resourceType: String { get { return "StructureDefinitionSnapshot" } diff --git a/Sources/Models/StructureMap.swift b/Sources/Models/StructureMap.swift index c2451fba..77cdc162 100644 --- a/Sources/Models/StructureMap.swift +++ b/Sources/Models/StructureMap.swift @@ -2,7 +2,7 @@ // StructureMap.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/StructureMap) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/StructureMap) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,8 +10,8 @@ import Foundation /** - * A Map of relationships between 2 structures that can be used to transform data. - */ +A Map of relationships between 2 structures that can be used to transform data. +*/ open class StructureMap: DomainResource { override open class var resourceType: String { get { return "StructureMap" } @@ -53,8 +53,8 @@ open class StructureMap: DomainResource { /// Why this structure map is defined. public var purpose: String? - /// draft | active | retired. - public var status: String? + /// The status of this structure map. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Structure Definition used by this map. public var structure: [StructureMapStructure]? @@ -73,7 +73,7 @@ open class StructureMap: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(group: [StructureMapGroup], name: String, status: String, url: URL) { + public convenience init(group: [StructureMapGroup], name: String, status: PublicationStatus, url: URL) { self.init() self.group = group self.name = name @@ -221,7 +221,12 @@ open class StructureMap: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -316,11 +321,7 @@ open class StructureMap: DomainResource { json["identifier"] = identifier.map() { $0.asJSON(errors: &errors) } } if let import_fhir = self.import_fhir { - var arr = [Any]() - for val in import_fhir { - arr.append(val.asJSON()) - } - json["import"] = arr + json["import"] = import_fhir.map() { $0.asJSON() } } if let jurisdiction = self.jurisdiction { json["jurisdiction"] = jurisdiction.map() { $0.asJSON(errors: &errors) } @@ -335,7 +336,7 @@ open class StructureMap: DomainResource { json["purpose"] = purpose.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let structure = self.structure { json["structure"] = structure.map() { $0.asJSON(errors: &errors) } @@ -359,8 +360,8 @@ open class StructureMap: DomainResource { /** - * Named sections for reader convenience. - */ +Named sections for reader convenience. +*/ open class StructureMapGroup: BackboneElement { override open class var resourceType: String { get { return "StructureMapGroup" } @@ -485,10 +486,10 @@ open class StructureMapGroup: BackboneElement { /** - * Named instance provided when invoking the map. - * - * A name assigned to an instance of data. The instance must be provided when the mapping is invoked. - */ +Named instance provided when invoking the map. + +A name assigned to an instance of data. The instance must be provided when the mapping is invoked. +*/ open class StructureMapGroupInput: BackboneElement { override open class var resourceType: String { get { return "StructureMapGroupInput" } @@ -497,8 +498,8 @@ open class StructureMapGroupInput: BackboneElement { /// Documentation for this instance of data. public var documentation: String? - /// source | target. - public var mode: String? + /// Mode for this instance of data. + public var mode: StructureMapInputMode? /// Name for this instance of data. public var name: String? @@ -508,7 +509,7 @@ open class StructureMapGroupInput: BackboneElement { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(mode: String, name: String) { + public convenience init(mode: StructureMapInputMode, name: String) { self.init() self.mode = mode self.name = name @@ -529,7 +530,12 @@ open class StructureMapGroupInput: BackboneElement { if let exist = json["mode"] { presentKeys.insert("mode") if let val = exist as? String { - self.mode = val + if let enumval = StructureMapInputMode(rawValue: val) { + self.mode = enumval + } + else { + errors.append(FHIRValidationError(key: "mode", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "mode", wants: String.self, has: type(of: exist))) @@ -569,7 +575,7 @@ open class StructureMapGroupInput: BackboneElement { json["documentation"] = documentation.asJSON() } if let mode = self.mode { - json["mode"] = mode.asJSON() + json["mode"] = mode.rawValue } if let name = self.name { json["name"] = name.asJSON() @@ -584,8 +590,8 @@ open class StructureMapGroupInput: BackboneElement { /** - * Transform Rule from source to target. - */ +Transform Rule from source to target. +*/ open class StructureMapGroupRule: BackboneElement { override open class var resourceType: String { get { return "StructureMapGroupRule" } @@ -731,8 +737,8 @@ open class StructureMapGroupRule: BackboneElement { /** - * Which other rules to apply in the context of this rule. - */ +Which other rules to apply in the context of this rule. +*/ open class StructureMapGroupRuleDependent: BackboneElement { override open class var resourceType: String { get { return "StructureMapGroupRuleDependent" } @@ -789,11 +795,7 @@ open class StructureMapGroupRuleDependent: BackboneElement { json["name"] = name.asJSON() } if let variable = self.variable { - var arr = [Any]() - for val in variable { - arr.append(val.asJSON()) - } - json["variable"] = arr + json["variable"] = variable.map() { $0.asJSON() } } return json @@ -802,8 +804,8 @@ open class StructureMapGroupRuleDependent: BackboneElement { /** - * Source inputs to the mapping. - */ +Source inputs to the mapping. +*/ open class StructureMapGroupRuleSource: BackboneElement { override open class var resourceType: String { get { return "StructureMapGroupRuleSource" } @@ -818,14 +820,14 @@ open class StructureMapGroupRuleSource: BackboneElement { /// Type or variable this rule applies to. public var context: String? - /// type | variable. - public var contextType: String? + /// How to interpret the context. + public var contextType: StructureMapContextType? /// Optional field for this source. public var element: String? - /// first | share | last. - public var listMode: String? + /// How to handle the list mode for this element. + public var listMode: StructureMapListMode? /// Whether this rule applies if the source isn't found. public var required: Bool? @@ -835,7 +837,7 @@ open class StructureMapGroupRuleSource: BackboneElement { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(context: String, contextType: String, required: Bool) { + public convenience init(context: String, contextType: StructureMapContextType, required: Bool) { self.init() self.context = context self.contextType = contextType @@ -878,7 +880,12 @@ open class StructureMapGroupRuleSource: BackboneElement { if let exist = json["contextType"] { presentKeys.insert("contextType") if let val = exist as? String { - self.contextType = val + if let enumval = StructureMapContextType(rawValue: val) { + self.contextType = enumval + } + else { + errors.append(FHIRValidationError(key: "contextType", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "contextType", wants: String.self, has: type(of: exist))) @@ -899,7 +906,12 @@ open class StructureMapGroupRuleSource: BackboneElement { if let exist = json["listMode"] { presentKeys.insert("listMode") if let val = exist as? String { - self.listMode = val + if let enumval = StructureMapListMode(rawValue: val) { + self.listMode = enumval + } + else { + errors.append(FHIRValidationError(key: "listMode", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "listMode", wants: String.self, has: type(of: exist))) @@ -942,13 +954,13 @@ open class StructureMapGroupRuleSource: BackboneElement { json["context"] = context.asJSON() } if let contextType = self.contextType { - json["contextType"] = contextType.asJSON() + json["contextType"] = contextType.rawValue } if let element = self.element { json["element"] = element.asJSON() } if let listMode = self.listMode { - json["listMode"] = listMode.asJSON() + json["listMode"] = listMode.rawValue } if let required = self.required { json["required"] = required.asJSON() @@ -963,8 +975,8 @@ open class StructureMapGroupRuleSource: BackboneElement { /** - * Content to create because of this mapping rule. - */ +Content to create because of this mapping rule. +*/ open class StructureMapGroupRuleTarget: BackboneElement { override open class var resourceType: String { get { return "StructureMapGroupRuleTarget" } @@ -973,14 +985,14 @@ open class StructureMapGroupRuleTarget: BackboneElement { /// Type or variable this rule applies to. public var context: String? - /// type | variable. - public var contextType: String? + /// How to interpret the context. + public var contextType: StructureMapContextType? /// Field to create in the context. public var element: String? - /// first | share | last. - public var listMode: [String]? + /// If field is a list, how to manage the list. + public var listMode: [StructureMapListMode]? /// Internal rule reference for shared list items. public var listRuleId: String? @@ -988,8 +1000,8 @@ open class StructureMapGroupRuleTarget: BackboneElement { /// Parameters to the transform. public var parameter: [StructureMapGroupRuleTargetParameter]? - /// create | copy +. - public var transform: String? + /// How the data is copied / created. + public var transform: StructureMapTransform? /// Named context for field, if desired, and a field is specified. public var variable: String? @@ -1009,7 +1021,12 @@ open class StructureMapGroupRuleTarget: BackboneElement { if let exist = json["contextType"] { presentKeys.insert("contextType") if let val = exist as? String { - self.contextType = val + if let enumval = StructureMapContextType(rawValue: val) { + self.contextType = enumval + } + else { + errors.append(FHIRValidationError(key: "contextType", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "contextType", wants: String.self, has: type(of: exist))) @@ -1026,8 +1043,12 @@ open class StructureMapGroupRuleTarget: BackboneElement { } if let exist = json["listMode"] { presentKeys.insert("listMode") - if let val = exist as? [String] { - self.listMode = val + if let val = exist as? [String] { var i = -1 + self.listMode = val.map() { i += 1 + if let enumval = StructureMapListMode(rawValue: $0) { return enumval } + errors.append(FHIRValidationError(key: "listMode.\(i)", problem: "the value “\(val)” is not valid")) + return nil + }.filter() { nil != $0 }.map() { $0! } } else { errors.append(FHIRValidationError(key: "listMode", wants: Array.self, has: type(of: exist))) @@ -1059,7 +1080,12 @@ open class StructureMapGroupRuleTarget: BackboneElement { if let exist = json["transform"] { presentKeys.insert("transform") if let val = exist as? String { - self.transform = val + if let enumval = StructureMapTransform(rawValue: val) { + self.transform = enumval + } + else { + errors.append(FHIRValidationError(key: "transform", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "transform", wants: String.self, has: type(of: exist))) @@ -1084,17 +1110,13 @@ open class StructureMapGroupRuleTarget: BackboneElement { json["context"] = context.asJSON() } if let contextType = self.contextType { - json["contextType"] = contextType.asJSON() + json["contextType"] = contextType.rawValue } if let element = self.element { json["element"] = element.asJSON() } if let listMode = self.listMode { - var arr = [Any]() - for val in listMode { - arr.append(val.asJSON()) - } - json["listMode"] = arr + json["listMode"] = listMode.map() { $0.rawValue } } if let listRuleId = self.listRuleId { json["listRuleId"] = listRuleId.asJSON() @@ -1103,7 +1125,7 @@ open class StructureMapGroupRuleTarget: BackboneElement { json["parameter"] = parameter.map() { $0.asJSON(errors: &errors) } } if let transform = self.transform { - json["transform"] = transform.asJSON() + json["transform"] = transform.rawValue } if let variable = self.variable { json["variable"] = variable.asJSON() @@ -1115,8 +1137,8 @@ open class StructureMapGroupRuleTarget: BackboneElement { /** - * Parameters to the transform. - */ +Parameters to the transform. +*/ open class StructureMapGroupRuleTargetParameter: BackboneElement { override open class var resourceType: String { get { return "StructureMapGroupRuleTargetParameter" } @@ -1242,11 +1264,11 @@ open class StructureMapGroupRuleTargetParameter: BackboneElement { /** - * Structure Definition used by this map. - * - * A structure definition used by this map. The structure definition may describe instances that are converted, or the - * instances that are produced. - */ +Structure Definition used by this map. + +A structure definition used by this map. The structure definition may describe instances that are converted, or the +instances that are produced. +*/ open class StructureMapStructure: BackboneElement { override open class var resourceType: String { get { return "StructureMapStructure" } @@ -1255,15 +1277,15 @@ open class StructureMapStructure: BackboneElement { /// Documentation on use of structure. public var documentation: String? - /// source | queried | target | produced. - public var mode: String? + /// How the referenced structure is used in this mapping. + public var mode: StructureMapModelMode? /// Canonical URL for structure definition. public var url: URL? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(mode: String, url: URL) { + public convenience init(mode: StructureMapModelMode, url: URL) { self.init() self.mode = mode self.url = url @@ -1284,7 +1306,12 @@ open class StructureMapStructure: BackboneElement { if let exist = json["mode"] { presentKeys.insert("mode") if let val = exist as? String { - self.mode = val + if let enumval = StructureMapModelMode(rawValue: val) { + self.mode = enumval + } + else { + errors.append(FHIRValidationError(key: "mode", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "mode", wants: String.self, has: type(of: exist))) @@ -1315,7 +1342,7 @@ open class StructureMapStructure: BackboneElement { json["documentation"] = documentation.asJSON() } if let mode = self.mode { - json["mode"] = mode.asJSON() + json["mode"] = mode.rawValue } if let url = self.url { json["url"] = url.asJSON() diff --git a/Sources/Models/Subscription.swift b/Sources/Models/Subscription.swift index 2876f1b0..9dd327f6 100644 --- a/Sources/Models/Subscription.swift +++ b/Sources/Models/Subscription.swift @@ -2,7 +2,7 @@ // Subscription.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Subscription) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Subscription) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,13 +10,13 @@ import Foundation /** - * A server push subscription criteria. - * - * The subscription resource is used to define a push based subscription from a server to another system. Once a - * subscription is registered with the server, the server checks every resource that is created or updated, and if the - * resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to - * take an appropriate action. - */ +A server push subscription criteria. + +The subscription resource is used to define a push based subscription from a server to another system. Once a +subscription is registered with the server, the server checks every resource that is created or updated, and if the +resource matches the given criteria, it sends a message on the defined "channel" so that another system is able to take +an appropriate action. +*/ open class Subscription: DomainResource { override open class var resourceType: String { get { return "Subscription" } @@ -40,15 +40,15 @@ open class Subscription: DomainResource { /// Description of why this subscription was created. public var reason: String? - /// requested | active | error | off. - public var status: String? + /// The status of the subscription, which marks the server state for managing the subscription. + public var status: SubscriptionStatus? /// A tag to add to matching resources. public var tag: [Coding]? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(channel: SubscriptionChannel, criteria: String, reason: String, status: String) { + public convenience init(channel: SubscriptionChannel, criteria: String, reason: String, status: SubscriptionStatus) { self.init() self.channel = channel self.criteria = criteria @@ -135,7 +135,12 @@ open class Subscription: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = SubscriptionStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -183,7 +188,7 @@ open class Subscription: DomainResource { json["reason"] = reason.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let tag = self.tag { json["tag"] = tag.map() { $0.asJSON(errors: &errors) } @@ -195,10 +200,10 @@ open class Subscription: DomainResource { /** - * The channel on which to report matches to the criteria. - * - * Details where to send notifications when resources are received that meet the criteria. - */ +The channel on which to report matches to the criteria. + +Details where to send notifications when resources are received that meet the criteria. +*/ open class SubscriptionChannel: BackboneElement { override open class var resourceType: String { get { return "SubscriptionChannel" } @@ -213,12 +218,12 @@ open class SubscriptionChannel: BackboneElement { /// Mimetype to send, or omit for no payload. public var payload: String? - /// rest-hook | websocket | email | sms | message. - public var type: String? + /// The type of channel to send notifications on. + public var type: SubscriptionChannelType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(type: String) { + public convenience init(type: SubscriptionChannelType) { self.init() self.type = type } @@ -256,7 +261,12 @@ open class SubscriptionChannel: BackboneElement { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = SubscriptionChannelType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -281,7 +291,7 @@ open class SubscriptionChannel: BackboneElement { json["payload"] = payload.asJSON() } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json diff --git a/Sources/Models/Substance.swift b/Sources/Models/Substance.swift index 2ac570a6..72621640 100644 --- a/Sources/Models/Substance.swift +++ b/Sources/Models/Substance.swift @@ -2,7 +2,7 @@ // Substance.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Substance) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Substance) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,8 +10,8 @@ import Foundation /** - * A homogeneous material with a definite composition. - */ +A homogeneous material with a definite composition. +*/ open class Substance: DomainResource { override open class var resourceType: String { get { return "Substance" } @@ -158,10 +158,10 @@ open class Substance: DomainResource { /** - * Composition information about the substance. - * - * A substance can be composed of other substances. - */ +Composition information about the substance. + +A substance can be composed of other substances. +*/ open class SubstanceIngredient: BackboneElement { override open class var resourceType: String { get { return "SubstanceIngredient" } @@ -263,11 +263,10 @@ open class SubstanceIngredient: BackboneElement { /** - * If this describes a specific package/container of the substance. - * - * Substance may be used to describe a kind of substance, or a specific package/container of the substance: an - * instance. - */ +If this describes a specific package/container of the substance. + +Substance may be used to describe a kind of substance, or a specific package/container of the substance: an instance. +*/ open class SubstanceInstance: BackboneElement { override open class var resourceType: String { get { return "SubstanceInstance" } diff --git a/Sources/Models/SupplyDelivery.swift b/Sources/Models/SupplyDelivery.swift index 54c311d6..c6732854 100644 --- a/Sources/Models/SupplyDelivery.swift +++ b/Sources/Models/SupplyDelivery.swift @@ -2,7 +2,7 @@ // SupplyDelivery.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/SupplyDelivery) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/SupplyDelivery) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Delivery of Supply. - * - * Record of delivery of what is supplied. - */ +Delivery of Supply. + +Record of delivery of what is supplied. +*/ open class SupplyDelivery: DomainResource { override open class var resourceType: String { get { return "SupplyDelivery" } @@ -34,8 +34,8 @@ open class SupplyDelivery: DomainResource { /// Who collected the Supply. public var receiver: [Reference]? - /// in-progress | completed | abandoned. - public var status: String? + /// A code specifying the state of the dispense event. + public var status: SupplyDeliveryStatus? /// Medication, Substance, or Device supplied. public var suppliedItemCodeableConcept: CodeableConcept? @@ -131,7 +131,12 @@ open class SupplyDelivery: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = SupplyDeliveryStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -238,7 +243,7 @@ open class SupplyDelivery: DomainResource { json["receiver"] = receiver.map() { $0.asJSON(errors: &errors) } } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let suppliedItemCodeableConcept = self.suppliedItemCodeableConcept { json["suppliedItemCodeableConcept"] = suppliedItemCodeableConcept.asJSON(errors: &errors) diff --git a/Sources/Models/SupplyRequest.swift b/Sources/Models/SupplyRequest.swift index d271867a..1d9060fb 100644 --- a/Sources/Models/SupplyRequest.swift +++ b/Sources/Models/SupplyRequest.swift @@ -2,7 +2,7 @@ // SupplyRequest.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/SupplyRequest) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/SupplyRequest) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Request for a medication, substance or device. - * - * A record of a request for a medication, substance or device used in the healthcare setting. - */ +Request for a medication, substance or device. + +A record of a request for a medication, substance or device used in the healthcare setting. +*/ open class SupplyRequest: DomainResource { override open class var resourceType: String { get { return "SupplyRequest" } @@ -46,8 +46,8 @@ open class SupplyRequest: DomainResource { /// Who initiated this order. public var source: Reference? - /// requested | completed | failed | cancelled. - public var status: String? + /// Status of the supply request. + public var status: SupplyRequestStatus? /// Who is intended to fulfill the request. public var supplier: [Reference]? @@ -182,7 +182,12 @@ open class SupplyRequest: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = SupplyRequestStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -250,7 +255,7 @@ open class SupplyRequest: DomainResource { json["source"] = source.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let supplier = self.supplier { json["supplier"] = supplier.map() { $0.asJSON(errors: &errors) } @@ -265,8 +270,8 @@ open class SupplyRequest: DomainResource { /** - * When the request should be fulfilled. - */ +When the request should be fulfilled. +*/ open class SupplyRequestWhen: BackboneElement { override open class var resourceType: String { get { return "SupplyRequestWhen" } diff --git a/Sources/Models/Task.swift b/Sources/Models/Task.swift index 3514609f..486068d7 100644 --- a/Sources/Models/Task.swift +++ b/Sources/Models/Task.swift @@ -2,7 +2,7 @@ // Task.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Task) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Task) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,8 +10,8 @@ import Foundation /** - * A task to be performed. - */ +A task to be performed. +*/ open class Task: DomainResource { override open class var resourceType: String { get { return "Task" } @@ -71,8 +71,8 @@ open class Task: DomainResource { /// requester | dispatcher | scheduler | performer | monitor | manager | acquirer | reviewer. public var performerType: [CodeableConcept]? - /// low | normal | high. - public var priority: String? + /// The priority of the task among other tasks of the same type. + public var priority: TaskPriority? /// Why task is needed. public var reason: CodeableConcept? @@ -86,15 +86,15 @@ open class Task: DomainResource { /// proposed | planned | actionable +. public var stage: CodeableConcept? - /// draft | requested | received | accepted | +. - public var status: String? + /// The current status of the task. + public var status: TaskStatus? /// Reason for current status. public var statusReason: CodeableConcept? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(created: DateTime, lastModified: DateTime, requester: Reference, stage: CodeableConcept, status: String) { + public convenience init(created: DateTime, lastModified: DateTime, requester: Reference, stage: CodeableConcept, status: TaskStatus) { self.init() self.created = created self.lastModified = lastModified @@ -347,7 +347,12 @@ open class Task: DomainResource { if let exist = json["priority"] { presentKeys.insert("priority") if let val = exist as? String { - self.priority = val + if let enumval = TaskPriority(rawValue: val) { + self.priority = enumval + } + else { + errors.append(FHIRValidationError(key: "priority", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "priority", wants: String.self, has: type(of: exist))) @@ -418,7 +423,12 @@ open class Task: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = TaskStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -502,7 +512,7 @@ open class Task: DomainResource { json["performerType"] = performerType.map() { $0.asJSON(errors: &errors) } } if let priority = self.priority { - json["priority"] = priority.asJSON() + json["priority"] = priority.rawValue } if let reason = self.reason { json["reason"] = reason.asJSON(errors: &errors) @@ -517,7 +527,7 @@ open class Task: DomainResource { json["stage"] = stage.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let statusReason = self.statusReason { json["statusReason"] = statusReason.asJSON(errors: &errors) @@ -529,10 +539,10 @@ open class Task: DomainResource { /** - * Constraints on fulfillment tasks. - * - * Identifies any limitations on what part of a referenced task subject request should be actioned. - */ +Constraints on fulfillment tasks. + +Identifies any limitations on what part of a referenced task subject request should be actioned. +*/ open class TaskFulfillment: BackboneElement { override open class var resourceType: String { get { return "TaskFulfillment" } @@ -609,10 +619,10 @@ open class TaskFulfillment: BackboneElement { /** - * Supporting information. - * - * Additional information that may be needed in the execution of the task. - */ +Supporting information. + +Additional information that may be needed in the execution of the task. +*/ open class TaskInput: BackboneElement { override open class var resourceType: String { get { return "TaskInput" } @@ -1466,10 +1476,10 @@ open class TaskInput: BackboneElement { /** - * Task Output. - * - * Outputs produced by the Task. - */ +Task Output. + +Outputs produced by the Task. +*/ open class TaskOutput: BackboneElement { override open class var resourceType: String { get { return "TaskOutput" } diff --git a/Sources/Models/TestReport.swift b/Sources/Models/TestReport.swift index a8af6230..beed2bdc 100644 --- a/Sources/Models/TestReport.swift +++ b/Sources/Models/TestReport.swift @@ -2,7 +2,7 @@ // TestReport.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/TestReport) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/TestReport) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Describes a set of tests. - * - * TestReport is a resource that includes summary information on the results of executing a TestScript. - */ +Describes a set of tests. + +TestReport is a resource that includes summary information on the results of executing a TestScript. +*/ open class TestReport: DomainResource { override open class var resourceType: String { get { return "TestReport" } @@ -37,8 +37,8 @@ open class TestReport: DomainResource { /// The results of the series of required setup operations before the tests were executed. public var setup: TestReportSetup? - /// complete | pending | error. - public var status: String? + /// The status of the TestReport. + public var status: TestReportStatus? /// The results of running the series of required clean up steps. public var teardown: TestReportTeardown? @@ -54,7 +54,7 @@ open class TestReport: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String, testScript: Reference) { + public convenience init(status: TestReportStatus, testScript: Reference) { self.init() self.status = status self.testScript = testScript @@ -135,7 +135,12 @@ open class TestReport: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = TestReportStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -223,7 +228,7 @@ open class TestReport: DomainResource { json["setup"] = setup.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let teardown = self.teardown { json["teardown"] = teardown.asJSON(errors: &errors) @@ -244,8 +249,8 @@ open class TestReport: DomainResource { /** - * A participant in the test execution, either the execution engine, a client, or a server. - */ +A participant in the test execution, either the execution engine, a client, or a server. +*/ open class TestReportParticipant: BackboneElement { override open class var resourceType: String { get { return "TestReportParticipant" } @@ -254,15 +259,15 @@ open class TestReportParticipant: BackboneElement { /// The display name of the participant. public var display: String? - /// test-engine | client | server. - public var type: String? + /// The type of participant. + public var type: TestReportParticipantType? /// The uri of the participant. An absolute URL is preferred. public var uri: URL? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(type: String, uri: URL) { + public convenience init(type: TestReportParticipantType, uri: URL) { self.init() self.type = type self.uri = uri @@ -283,7 +288,12 @@ open class TestReportParticipant: BackboneElement { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = TestReportParticipantType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -314,7 +324,7 @@ open class TestReportParticipant: BackboneElement { json["display"] = display.asJSON() } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } if let uri = self.uri { json["uri"] = uri.asJSON() @@ -326,8 +336,8 @@ open class TestReportParticipant: BackboneElement { /** - * The results of the series of required setup operations before the tests were executed. - */ +The results of the series of required setup operations before the tests were executed. +*/ open class TestReportSetup: BackboneElement { override open class var resourceType: String { get { return "TestReportSetup" } @@ -379,10 +389,10 @@ open class TestReportSetup: BackboneElement { /** - * A setup operation or assert that was executed. - * - * Action would contain either an operation or an assertion. - */ +A setup operation or assert that was executed. + +Action would contain either an operation or an assertion. +*/ open class TestReportSetupAction: BackboneElement { override open class var resourceType: String { get { return "TestReportSetupAction" } @@ -444,10 +454,10 @@ open class TestReportSetupAction: BackboneElement { /** - * The assertion to perform. - * - * The results of the assertion performed on the previous operations. - */ +The assertion to perform. + +The results of the assertion performed on the previous operations. +*/ open class TestReportSetupActionAssert: BackboneElement { override open class var resourceType: String { get { return "TestReportSetupActionAssert" } @@ -459,12 +469,12 @@ open class TestReportSetupActionAssert: BackboneElement { /// A message associated with the result. public var message: String? - /// pass | skip | fail | warning | error. - public var result: String? + /// The result of this assertion. + public var result: TestReportResultCodes? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(result: String) { + public convenience init(result: TestReportResultCodes) { self.init() self.result = result } @@ -493,7 +503,12 @@ open class TestReportSetupActionAssert: BackboneElement { if let exist = json["result"] { presentKeys.insert("result") if let val = exist as? String { - self.result = val + if let enumval = TestReportResultCodes(rawValue: val) { + self.result = enumval + } + else { + errors.append(FHIRValidationError(key: "result", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "result", wants: String.self, has: type(of: exist))) @@ -515,7 +530,7 @@ open class TestReportSetupActionAssert: BackboneElement { json["message"] = message.asJSON() } if let result = self.result { - json["result"] = result.asJSON() + json["result"] = result.rawValue } return json @@ -524,10 +539,10 @@ open class TestReportSetupActionAssert: BackboneElement { /** - * The operation to perform. - * - * The operation performed. - */ +The operation to perform. + +The operation performed. +*/ open class TestReportSetupActionOperation: BackboneElement { override open class var resourceType: String { get { return "TestReportSetupActionOperation" } @@ -539,12 +554,12 @@ open class TestReportSetupActionOperation: BackboneElement { /// A message associated with the result. public var message: String? - /// pass | skip | fail | warning | error. - public var result: String? + /// The result of this operation. + public var result: TestReportResultCodes? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(result: String) { + public convenience init(result: TestReportResultCodes) { self.init() self.result = result } @@ -573,7 +588,12 @@ open class TestReportSetupActionOperation: BackboneElement { if let exist = json["result"] { presentKeys.insert("result") if let val = exist as? String { - self.result = val + if let enumval = TestReportResultCodes(rawValue: val) { + self.result = enumval + } + else { + errors.append(FHIRValidationError(key: "result", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "result", wants: String.self, has: type(of: exist))) @@ -595,7 +615,7 @@ open class TestReportSetupActionOperation: BackboneElement { json["message"] = message.asJSON() } if let result = self.result { - json["result"] = result.asJSON() + json["result"] = result.rawValue } return json @@ -604,11 +624,11 @@ open class TestReportSetupActionOperation: BackboneElement { /** - * The results of running the series of required clean up steps. - * - * The results of the series of operations required to clean up after the all the tests were executed (successfully or - * otherwise). - */ +The results of running the series of required clean up steps. + +The results of the series of operations required to clean up after the all the tests were executed (successfully or +otherwise). +*/ open class TestReportTeardown: BackboneElement { override open class var resourceType: String { get { return "TestReportTeardown" } @@ -660,10 +680,10 @@ open class TestReportTeardown: BackboneElement { /** - * One or more teardown operations performed. - * - * The teardown action will only contain an operation. - */ +One or more teardown operations performed. + +The teardown action will only contain an operation. +*/ open class TestReportTeardownAction: BackboneElement { override open class var resourceType: String { get { return "TestReportTeardownAction" } @@ -715,8 +735,8 @@ open class TestReportTeardownAction: BackboneElement { /** - * A test executed from the test script. - */ +A test executed from the test script. +*/ open class TestReportTest: BackboneElement { override open class var resourceType: String { get { return "TestReportTest" } @@ -798,10 +818,10 @@ open class TestReportTest: BackboneElement { /** - * A test operation or assert that was performed. - * - * Action would contain either an operation or an assertion. - */ +A test operation or assert that was performed. + +Action would contain either an operation or an assertion. +*/ open class TestReportTestAction: BackboneElement { override open class var resourceType: String { get { return "TestReportTestAction" } diff --git a/Sources/Models/TestScript.swift b/Sources/Models/TestScript.swift index fc48e639..e507d0a7 100644 --- a/Sources/Models/TestScript.swift +++ b/Sources/Models/TestScript.swift @@ -2,7 +2,7 @@ // TestScript.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/TestScript) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/TestScript) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,11 +10,11 @@ import Foundation /** - * Describes a set of tests. - * - * TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine - * compliance against the FHIR specification. - */ +Describes a set of tests. + +TestScript is a resource that specifies a suite of tests against a FHIR server implementation to determine compliance +against the FHIR specification. +*/ open class TestScript: DomainResource { override open class var resourceType: String { get { return "TestScript" } @@ -74,8 +74,8 @@ open class TestScript: DomainResource { /// A series of required setup operations before tests are executed. public var setup: TestScriptSetup? - /// draft | active | retired. - public var status: String? + /// The status of this test script. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// A series of required clean up steps. public var teardown: TestScriptTeardown? @@ -100,7 +100,7 @@ open class TestScript: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(name: String, status: String, url: URL) { + public convenience init(name: String, status: PublicationStatus, url: URL) { self.init() self.name = name self.status = status @@ -333,7 +333,12 @@ open class TestScript: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -489,7 +494,7 @@ open class TestScript: DomainResource { json["setup"] = setup.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let teardown = self.teardown { json["teardown"] = teardown.asJSON(errors: &errors) @@ -519,10 +524,10 @@ open class TestScript: DomainResource { /** - * An abstract server representing a destination or receiver in a message exchange. - * - * An abstract server used in operations within this test script in the destination element. - */ +An abstract server representing a destination or receiver in a message exchange. + +An abstract server used in operations within this test script in the destination element. +*/ open class TestScriptDestination: BackboneElement { override open class var resourceType: String { get { return "TestScriptDestination" } @@ -593,10 +598,10 @@ open class TestScriptDestination: BackboneElement { /** - * Fixture in the test script - by reference (uri). - * - * Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute. - */ +Fixture in the test script - by reference (uri). + +Fixture in the test script - by reference (uri). All fixtures are required for the test script to execute. +*/ open class TestScriptFixture: BackboneElement { override open class var resourceType: String { get { return "TestScriptFixture" } @@ -668,10 +673,10 @@ open class TestScriptFixture: BackboneElement { /** - * Required capability that is assumed to function correctly on the FHIR server being tested. - * - * The required capability must exist and are assumed to function correctly on the FHIR server being tested. - */ +Required capability that is assumed to function correctly on the FHIR server being tested. + +The required capability must exist and are assumed to function correctly on the FHIR server being tested. +*/ open class TestScriptMetadata: BackboneElement { override open class var resourceType: String { get { return "TestScriptMetadata" } @@ -743,10 +748,10 @@ open class TestScriptMetadata: BackboneElement { /** - * Capabilities that are assumed to function correctly on the FHIR server being tested. - * - * Capabilities that must exist and are assumed to function correctly on the FHIR server being tested. - */ +Capabilities that are assumed to function correctly on the FHIR server being tested. + +Capabilities that must exist and are assumed to function correctly on the FHIR server being tested. +*/ open class TestScriptMetadataCapability: BackboneElement { override open class var resourceType: String { get { return "TestScriptMetadataCapability" } @@ -870,18 +875,10 @@ open class TestScriptMetadataCapability: BackboneElement { json["destination"] = destination.asJSON() } if let link = self.link { - var arr = [Any]() - for val in link { - arr.append(val.asJSON()) - } - json["link"] = arr + json["link"] = link.map() { $0.asJSON() } } if let origin = self.origin { - var arr = [Any]() - for val in origin { - arr.append(val.asJSON()) - } - json["origin"] = arr + json["origin"] = origin.map() { $0.asJSON() } } if let required = self.required { json["required"] = required.asJSON() @@ -896,10 +893,10 @@ open class TestScriptMetadataCapability: BackboneElement { /** - * Links to the FHIR specification. - * - * A link to the FHIR specification that this test is covering. - */ +Links to the FHIR specification. + +A link to the FHIR specification that this test is covering. +*/ open class TestScriptMetadataLink: BackboneElement { override open class var resourceType: String { get { return "TestScriptMetadataLink" } @@ -961,10 +958,10 @@ open class TestScriptMetadataLink: BackboneElement { /** - * An abstract server representing a client or sender in a message exchange. - * - * An abstract server used in operations within this test script in the origin element. - */ +An abstract server representing a client or sender in a message exchange. + +An abstract server used in operations within this test script in the origin element. +*/ open class TestScriptOrigin: BackboneElement { override open class var resourceType: String { get { return "TestScriptOrigin" } @@ -1035,10 +1032,10 @@ open class TestScriptOrigin: BackboneElement { /** - * Assert rule used within the test script. - * - * Assert rule to be used in one or more asserts within the test script. - */ +Assert rule used within the test script. + +Assert rule to be used in one or more asserts within the test script. +*/ open class TestScriptRule: BackboneElement { override open class var resourceType: String { get { return "TestScriptRule" } @@ -1110,10 +1107,10 @@ open class TestScriptRule: BackboneElement { /** - * Rule parameter template. - * - * Each rule template can take one or more parameters for rule evaluation. - */ +Rule parameter template. + +Each rule template can take one or more parameters for rule evaluation. +*/ open class TestScriptRuleParam: BackboneElement { override open class var resourceType: String { get { return "TestScriptRuleParam" } @@ -1175,11 +1172,11 @@ open class TestScriptRuleParam: BackboneElement { /** - * Assert ruleset used within the test script. - * - * Contains one or more rules. Offers a way to group rules so assertions could reference the group of rules and have - * them all applied. - */ +Assert ruleset used within the test script. + +Contains one or more rules. Offers a way to group rules so assertions could reference the group of rules and have them +all applied. +*/ open class TestScriptRuleset: BackboneElement { override open class var resourceType: String { get { return "TestScriptRuleset" } @@ -1255,10 +1252,10 @@ open class TestScriptRuleset: BackboneElement { /** - * The referenced rule within the ruleset. - * - * The referenced rule within the external ruleset template. - */ +The referenced rule within the ruleset. + +The referenced rule within the external ruleset template. +*/ open class TestScriptRulesetRule: BackboneElement { override open class var resourceType: String { get { return "TestScriptRulesetRule" } @@ -1325,10 +1322,10 @@ open class TestScriptRulesetRule: BackboneElement { /** - * Ruleset rule parameter template. - * - * Each rule template can take one or more parameters for rule evaluation. - */ +Ruleset rule parameter template. + +Each rule template can take one or more parameters for rule evaluation. +*/ open class TestScriptRulesetRuleParam: BackboneElement { override open class var resourceType: String { get { return "TestScriptRulesetRuleParam" } @@ -1390,8 +1387,8 @@ open class TestScriptRulesetRuleParam: BackboneElement { /** - * A series of required setup operations before tests are executed. - */ +A series of required setup operations before tests are executed. +*/ open class TestScriptSetup: BackboneElement { override open class var resourceType: String { get { return "TestScriptSetup" } @@ -1443,10 +1440,10 @@ open class TestScriptSetup: BackboneElement { /** - * A setup operation or assert to perform. - * - * Action would contain either an operation or an assertion. - */ +A setup operation or assert to perform. + +Action would contain either an operation or an assertion. +*/ open class TestScriptSetupAction: BackboneElement { override open class var resourceType: String { get { return "TestScriptSetupAction" } @@ -1508,10 +1505,10 @@ open class TestScriptSetupAction: BackboneElement { /** - * The assertion to perform. - * - * Evaluates the results of previous operations to determine if the server under test behaves appropriately. - */ +The assertion to perform. + +Evaluates the results of previous operations to determine if the server under test behaves appropriately. +*/ open class TestScriptSetupActionAssert: BackboneElement { override open class var resourceType: String { get { return "TestScriptSetupActionAssert" } @@ -1526,14 +1523,14 @@ open class TestScriptSetupActionAssert: BackboneElement { /// XPath or JSONPath expression to evaluate against the source fixture. public var compareToSourcePath: String? - /// xml | json | ttl | none. - public var contentType: String? + /// The content-type or mime-type to use for RESTful operation in the 'Content-Type' header. + public var contentType: ContentType? /// Tracking/reporting assertion description. public var description_fhir: String? - /// response | request. - public var direction: String? + /// The direction to use for the assertion. + public var direction: AssertionDirectionType? /// The fhirpath expression to be evaluated. public var expression: String? @@ -1550,8 +1547,8 @@ open class TestScriptSetupActionAssert: BackboneElement { /// Perform validation on navigation links?. public var navigationLinks: Bool? - /// equals | notEquals | in | notIn | greaterThan | lessThan | empty | notEmpty | contains | notContains. - public var operator_fhir: String? + /// The operator type defines the conditional behavior of the assert. If not defined, the default is equals. + public var operator_fhir: AssertionOperatorType? /// XPath or JSONPath expression. public var path: String? @@ -1562,8 +1559,8 @@ open class TestScriptSetupActionAssert: BackboneElement { /// Resource type. public var resource: String? - /// okay | created | noContent | notModified | bad | forbidden | notFound | methodNotAllowed | conflict | gone | preconditionFailed | unprocessable. - public var response: String? + /// None + public var response: AssertionResponseTypes? /// HTTP response code to test. public var responseCode: String? @@ -1619,7 +1616,12 @@ open class TestScriptSetupActionAssert: BackboneElement { if let exist = json["contentType"] { presentKeys.insert("contentType") if let val = exist as? String { - self.contentType = val + if let enumval = ContentType(rawValue: val) { + self.contentType = enumval + } + else { + errors.append(FHIRValidationError(key: "contentType", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "contentType", wants: String.self, has: type(of: exist))) @@ -1637,7 +1639,12 @@ open class TestScriptSetupActionAssert: BackboneElement { if let exist = json["direction"] { presentKeys.insert("direction") if let val = exist as? String { - self.direction = val + if let enumval = AssertionDirectionType(rawValue: val) { + self.direction = enumval + } + else { + errors.append(FHIRValidationError(key: "direction", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "direction", wants: String.self, has: type(of: exist))) @@ -1691,7 +1698,12 @@ open class TestScriptSetupActionAssert: BackboneElement { if let exist = json["operator"] { presentKeys.insert("operator") if let val = exist as? String { - self.operator_fhir = val + if let enumval = AssertionOperatorType(rawValue: val) { + self.operator_fhir = enumval + } + else { + errors.append(FHIRValidationError(key: "operator", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "operator", wants: String.self, has: type(of: exist))) @@ -1727,7 +1739,12 @@ open class TestScriptSetupActionAssert: BackboneElement { if let exist = json["response"] { presentKeys.insert("response") if let val = exist as? String { - self.response = val + if let enumval = AssertionResponseTypes(rawValue: val) { + self.response = enumval + } + else { + errors.append(FHIRValidationError(key: "response", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "response", wants: String.self, has: type(of: exist))) @@ -1822,13 +1839,13 @@ open class TestScriptSetupActionAssert: BackboneElement { json["compareToSourcePath"] = compareToSourcePath.asJSON() } if let contentType = self.contentType { - json["contentType"] = contentType.asJSON() + json["contentType"] = contentType.rawValue } if let description_fhir = self.description_fhir { json["description"] = description_fhir.asJSON() } if let direction = self.direction { - json["direction"] = direction.asJSON() + json["direction"] = direction.rawValue } if let expression = self.expression { json["expression"] = expression.asJSON() @@ -1846,7 +1863,7 @@ open class TestScriptSetupActionAssert: BackboneElement { json["navigationLinks"] = navigationLinks.asJSON() } if let operator_fhir = self.operator_fhir { - json["operator"] = operator_fhir.asJSON() + json["operator"] = operator_fhir.rawValue } if let path = self.path { json["path"] = path.asJSON() @@ -1858,7 +1875,7 @@ open class TestScriptSetupActionAssert: BackboneElement { json["resource"] = resource.asJSON() } if let response = self.response { - json["response"] = response.asJSON() + json["response"] = response.rawValue } if let responseCode = self.responseCode { json["responseCode"] = responseCode.asJSON() @@ -1888,10 +1905,10 @@ open class TestScriptSetupActionAssert: BackboneElement { /** - * The reference to a TestScript.rule. - * - * The TestScript.rule this assert will evaluate. - */ +The reference to a TestScript.rule. + +The TestScript.rule this assert will evaluate. +*/ open class TestScriptSetupActionAssertRule: BackboneElement { override open class var resourceType: String { get { return "TestScriptSetupActionAssertRule" } @@ -1958,10 +1975,10 @@ open class TestScriptSetupActionAssertRule: BackboneElement { /** - * Rule parameter template. - * - * Each rule template can take one or more parameters for rule evaluation. - */ +Rule parameter template. + +Each rule template can take one or more parameters for rule evaluation. +*/ open class TestScriptSetupActionAssertRuleParam: BackboneElement { override open class var resourceType: String { get { return "TestScriptSetupActionAssertRuleParam" } @@ -2027,10 +2044,10 @@ open class TestScriptSetupActionAssertRuleParam: BackboneElement { /** - * The reference to a TestScript.ruleset. - * - * The TestScript.ruleset this assert will evaluate. - */ +The reference to a TestScript.ruleset. + +The TestScript.ruleset this assert will evaluate. +*/ open class TestScriptSetupActionAssertRuleset: BackboneElement { override open class var resourceType: String { get { return "TestScriptSetupActionAssertRuleset" } @@ -2097,10 +2114,10 @@ open class TestScriptSetupActionAssertRuleset: BackboneElement { /** - * The referenced rule within the ruleset. - * - * The referenced rule within the external ruleset template. - */ +The referenced rule within the ruleset. + +The referenced rule within the external ruleset template. +*/ open class TestScriptSetupActionAssertRulesetRule: BackboneElement { override open class var resourceType: String { get { return "TestScriptSetupActionAssertRulesetRule" } @@ -2167,10 +2184,10 @@ open class TestScriptSetupActionAssertRulesetRule: BackboneElement { /** - * Rule parameter template. - * - * Each rule template can take one or more parameters for rule evaluation. - */ +Rule parameter template. + +Each rule template can take one or more parameters for rule evaluation. +*/ open class TestScriptSetupActionAssertRulesetRuleParam: BackboneElement { override open class var resourceType: String { get { return "TestScriptSetupActionAssertRulesetRuleParam" } @@ -2236,20 +2253,20 @@ open class TestScriptSetupActionAssertRulesetRuleParam: BackboneElement { /** - * The setup operation to perform. - * - * The operation to perform. - */ +The setup operation to perform. + +The operation to perform. +*/ open class TestScriptSetupActionOperation: BackboneElement { override open class var resourceType: String { get { return "TestScriptSetupActionOperation" } } - /// xml | json | ttl | none. - public var accept: String? + /// The content-type or mime-type to use for RESTful operation in the 'Accept' header. + public var accept: ContentType? - /// xml | json | ttl | none. - public var contentType: String? + /// The content-type or mime-type to use for RESTful operation in the 'Content-Type' header. + public var contentType: ContentType? /// Tracking/reporting operation description. public var description_fhir: String? @@ -2299,7 +2316,12 @@ open class TestScriptSetupActionOperation: BackboneElement { if let exist = json["accept"] { presentKeys.insert("accept") if let val = exist as? String { - self.accept = val + if let enumval = ContentType(rawValue: val) { + self.accept = enumval + } + else { + errors.append(FHIRValidationError(key: "accept", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "accept", wants: String.self, has: type(of: exist))) @@ -2308,7 +2330,12 @@ open class TestScriptSetupActionOperation: BackboneElement { if let exist = json["contentType"] { presentKeys.insert("contentType") if let val = exist as? String { - self.contentType = val + if let enumval = ContentType(rawValue: val) { + self.contentType = enumval + } + else { + errors.append(FHIRValidationError(key: "contentType", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "contentType", wants: String.self, has: type(of: exist))) @@ -2457,10 +2484,10 @@ open class TestScriptSetupActionOperation: BackboneElement { var json = super.asJSON(errors: &errors) if let accept = self.accept { - json["accept"] = accept.asJSON() + json["accept"] = accept.rawValue } if let contentType = self.contentType { - json["contentType"] = contentType.asJSON() + json["contentType"] = contentType.rawValue } if let description_fhir = self.description_fhir { json["description"] = description_fhir.asJSON() @@ -2511,10 +2538,10 @@ open class TestScriptSetupActionOperation: BackboneElement { /** - * Each operation can have one ore more header elements. - * - * Header elements would be used to set HTTP headers. - */ +Each operation can have one ore more header elements. + +Header elements would be used to set HTTP headers. +*/ open class TestScriptSetupActionOperationRequestHeader: BackboneElement { override open class var resourceType: String { get { return "TestScriptSetupActionOperationRequestHeader" } @@ -2580,10 +2607,10 @@ open class TestScriptSetupActionOperationRequestHeader: BackboneElement { /** - * A series of required clean up steps. - * - * A series of operations required to clean up after the all the tests are executed (successfully or otherwise). - */ +A series of required clean up steps. + +A series of operations required to clean up after the all the tests are executed (successfully or otherwise). +*/ open class TestScriptTeardown: BackboneElement { override open class var resourceType: String { get { return "TestScriptTeardown" } @@ -2635,10 +2662,10 @@ open class TestScriptTeardown: BackboneElement { /** - * One or more teardown operations to perform. - * - * The teardown action will only contain an operation. - */ +One or more teardown operations to perform. + +The teardown action will only contain an operation. +*/ open class TestScriptTeardownAction: BackboneElement { override open class var resourceType: String { get { return "TestScriptTeardownAction" } @@ -2690,8 +2717,8 @@ open class TestScriptTeardownAction: BackboneElement { /** - * A test in this script. - */ +A test in this script. +*/ open class TestScriptTest: BackboneElement { override open class var resourceType: String { get { return "TestScriptTest" } @@ -2773,10 +2800,10 @@ open class TestScriptTest: BackboneElement { /** - * A test operation or assert to perform. - * - * Action would contain either an operation or an assertion. - */ +A test operation or assert to perform. + +Action would contain either an operation or an assertion. +*/ open class TestScriptTestAction: BackboneElement { override open class var resourceType: String { get { return "TestScriptTestAction" } @@ -2838,10 +2865,10 @@ open class TestScriptTestAction: BackboneElement { /** - * Placeholder for evaluated elements. - * - * Variable is set based either on element value in response body or on header field value in the response headers. - */ +Placeholder for evaluated elements. + +Variable is set based either on element value in response body or on header field value in the response headers. +*/ open class TestScriptVariable: BackboneElement { override open class var resourceType: String { get { return "TestScriptVariable" } @@ -2850,12 +2877,18 @@ open class TestScriptVariable: BackboneElement { /// Default, hard-coded, or user-defined value for this variable. public var defaultValue: String? + /// Natural language description of the variable. + public var description_fhir: String? + /// The fhirpath expression against the fixture body. public var expression: String? /// HTTP header field name for source. public var headerField: String? + /// Hint help text for default value to enter. + public var hint: String? + /// Descriptive name for this variable. public var name: String? @@ -2884,6 +2917,15 @@ open class TestScriptVariable: BackboneElement { errors.append(FHIRValidationError(key: "defaultValue", wants: String.self, has: type(of: exist))) } } + if let exist = json["description"] { + presentKeys.insert("description") + if let val = exist as? String { + self.description_fhir = val + } + else { + errors.append(FHIRValidationError(key: "description", wants: String.self, has: type(of: exist))) + } + } if let exist = json["expression"] { presentKeys.insert("expression") if let val = exist as? String { @@ -2902,6 +2944,15 @@ open class TestScriptVariable: BackboneElement { errors.append(FHIRValidationError(key: "headerField", wants: String.self, has: type(of: exist))) } } + if let exist = json["hint"] { + presentKeys.insert("hint") + if let val = exist as? String { + self.hint = val + } + else { + errors.append(FHIRValidationError(key: "hint", wants: String.self, has: type(of: exist))) + } + } if let exist = json["name"] { presentKeys.insert("name") if let val = exist as? String { @@ -2941,12 +2992,18 @@ open class TestScriptVariable: BackboneElement { if let defaultValue = self.defaultValue { json["defaultValue"] = defaultValue.asJSON() } + if let description_fhir = self.description_fhir { + json["description"] = description_fhir.asJSON() + } if let expression = self.expression { json["expression"] = expression.asJSON() } if let headerField = self.headerField { json["headerField"] = headerField.asJSON() } + if let hint = self.hint { + json["hint"] = hint.asJSON() + } if let name = self.name { json["name"] = name.asJSON() } diff --git a/Sources/Models/Timing.swift b/Sources/Models/Timing.swift index c3438e39..3936a6dc 100644 --- a/Sources/Models/Timing.swift +++ b/Sources/Models/Timing.swift @@ -2,7 +2,7 @@ // Timing.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/Timing) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/Timing) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,12 +10,12 @@ import Foundation /** - * A timing schedule that specifies an event that may occur multiple times. - * - * Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or - * requested to occur. The most common usage is in dosage instructions for medications. They are also used when - * planning care of various kinds. - */ +A timing schedule that specifies an event that may occur multiple times. + +Specifies an event that may occur multiple times. Timing schedules are used to record when things are expected or +requested to occur. The most common usage is in dosage instructions for medications. They are also used when planning +care of various kinds. +*/ open class Timing: Element { override open class var resourceType: String { get { return "Timing" } @@ -80,11 +80,7 @@ open class Timing: Element { json["code"] = code.asJSON(errors: &errors) } if let event = self.event { - var arr = [Any]() - for val in event { - arr.append(val.asJSON()) - } - json["event"] = arr + json["event"] = event.map() { $0.asJSON() } } if let repeat_fhir = self.repeat_fhir { json["repeat"] = repeat_fhir.asJSON(errors: &errors) @@ -96,10 +92,10 @@ open class Timing: Element { /** - * When the event is to occur. - * - * A set of rules that describe when the event should occur. - */ +When the event is to occur. + +A set of rules that describe when the event should occur. +*/ open class TimingRepeat: Element { override open class var resourceType: String { get { return "TimingRepeat" } diff --git a/Sources/Models/TriggerDefinition.swift b/Sources/Models/TriggerDefinition.swift index 2c6e8862..2002f31c 100644 --- a/Sources/Models/TriggerDefinition.swift +++ b/Sources/Models/TriggerDefinition.swift @@ -2,7 +2,7 @@ // TriggerDefinition.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/TriggerDefinition) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/TriggerDefinition) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Defines an expected trigger for a module. - * - * A description of a triggering event. - */ +Defines an expected trigger for a module. + +A description of a triggering event. +*/ open class TriggerDefinition: Element { override open class var resourceType: String { get { return "TriggerDefinition" } @@ -37,12 +37,12 @@ open class TriggerDefinition: Element { /// Timing of the event. public var eventTimingTiming: Timing? - /// named-event | periodic | data-added | data-modified | data-removed | data-accessed | data-access-ended. - public var type: String? + /// The type of triggering event. + public var type: TriggerType? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(type: String) { + public convenience init(type: TriggerType) { self.init() self.type = type } @@ -122,7 +122,12 @@ open class TriggerDefinition: Element { if let exist = json["type"] { presentKeys.insert("type") if let val = exist as? String { - self.type = val + if let enumval = TriggerType(rawValue: val) { + self.type = enumval + } + else { + errors.append(FHIRValidationError(key: "type", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "type", wants: String.self, has: type(of: exist))) @@ -156,7 +161,7 @@ open class TriggerDefinition: Element { json["eventTimingTiming"] = eventTimingTiming.asJSON(errors: &errors) } if let type = self.type { - json["type"] = type.asJSON() + json["type"] = type.rawValue } return json diff --git a/Sources/Models/UsageContext.swift b/Sources/Models/UsageContext.swift index 1cff57c5..dcddb875 100644 --- a/Sources/Models/UsageContext.swift +++ b/Sources/Models/UsageContext.swift @@ -2,7 +2,7 @@ // UsageContext.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/UsageContext) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/UsageContext) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,12 +10,12 @@ import Foundation /** - * Describes the context of use for a knowledge resource. - * - * Specifies clinical/business/etc metadata that can be used to retrieve, index and/or categorize an artifact. This - * metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context of - * care (e.g., venue, care setting, provider of care). - */ +Describes the context of use for a conformance or knowledge resource. + +Specifies clinical/business/etc metadata that can be used to retrieve, index and/or categorize an artifact. This +metadata can either be specific to the applicable population (e.g., age category, DRG) or the specific context of care +(e.g., venue, care setting, provider of care). +*/ open class UsageContext: Element { override open class var resourceType: String { get { return "UsageContext" } diff --git a/Sources/Models/ValueSet.swift b/Sources/Models/ValueSet.swift index d20bdec8..81fec786 100644 --- a/Sources/Models/ValueSet.swift +++ b/Sources/Models/ValueSet.swift @@ -2,7 +2,7 @@ // ValueSet.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/ValueSet) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/ValueSet) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * A set of codes drawn from one or more code systems. - * - * A value set specifies a set of codes drawn from one or more code systems. - */ +A set of codes drawn from one or more code systems. + +A value set specifies a set of codes drawn from one or more code systems. +*/ open class ValueSet: DomainResource { override open class var resourceType: String { get { return "ValueSet" } @@ -61,8 +61,8 @@ open class ValueSet: DomainResource { /// Why this value set is defined. public var purpose: String? - /// draft | active | retired. - public var status: String? + /// The status of this value set. Enables tracking the life-cycle of the content. + public var status: PublicationStatus? /// Name for this value set (Human friendly). public var title: String? @@ -78,7 +78,7 @@ open class ValueSet: DomainResource { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: PublicationStatus) { self.init() self.status = status } @@ -240,7 +240,12 @@ open class ValueSet: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = PublicationStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -339,7 +344,7 @@ open class ValueSet: DomainResource { json["purpose"] = purpose.asJSON() } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } if let title = self.title { json["title"] = title.asJSON() @@ -360,11 +365,11 @@ open class ValueSet: DomainResource { /** - * Definition of the content of the value set (CLD). - * - * A set of criteria that define the content logical definition of the value set by including or excluding codes from - * outside this value set. This I also known as the "Content Logical Definition" (CLD). - */ +Definition of the content of the value set (CLD). + +A set of criteria that define the content logical definition of the value set by including or excluding codes from +outside this value set. This I also known as the "Content Logical Definition" (CLD). +*/ open class ValueSetCompose: BackboneElement { override open class var resourceType: String { get { return "ValueSetCompose" } @@ -451,8 +456,8 @@ open class ValueSetCompose: BackboneElement { /** - * Include one or more codes from a code system or other value set(s). - */ +Include one or more codes from a code system or other value set(s). +*/ open class ValueSetComposeInclude: BackboneElement { override open class var resourceType: String { get { return "ValueSetComposeInclude" } @@ -547,11 +552,7 @@ open class ValueSetComposeInclude: BackboneElement { json["system"] = system.asJSON() } if let valueSet = self.valueSet { - var arr = [Any]() - for val in valueSet { - arr.append(val.asJSON()) - } - json["valueSet"] = arr + json["valueSet"] = valueSet.map() { $0.asJSON() } } if let version = self.version { json["version"] = version.asJSON() @@ -563,10 +564,10 @@ open class ValueSetComposeInclude: BackboneElement { /** - * A concept defined in the system. - * - * Specifies a concept to be included or excluded. - */ +A concept defined in the system. + +Specifies a concept to be included or excluded. +*/ open class ValueSetComposeIncludeConcept: BackboneElement { override open class var resourceType: String { get { return "ValueSetComposeIncludeConcept" } @@ -648,11 +649,11 @@ open class ValueSetComposeIncludeConcept: BackboneElement { /** - * Additional representations for this concept. - * - * Additional representations for this concept when used in this value set - other languages, aliases, specialized - * purposes, used for particular purposes, etc. - */ +Additional representations for this concept. + +Additional representations for this concept when used in this value set - other languages, aliases, specialized +purposes, used for particular purposes, etc. +*/ open class ValueSetComposeIncludeConceptDesignation: BackboneElement { override open class var resourceType: String { get { return "ValueSetComposeIncludeConceptDesignation" } @@ -734,18 +735,18 @@ open class ValueSetComposeIncludeConceptDesignation: BackboneElement { /** - * Select codes/concepts by their properties (including relationships). - * - * Select concepts by specify a matching criteria based on the properties (including relationships) defined by the - * system. If multiple filters are specified, they SHALL all be true. - */ +Select codes/concepts by their properties (including relationships). + +Select concepts by specify a matching criteria based on the properties (including relationships) defined by the system. +If multiple filters are specified, they SHALL all be true. +*/ open class ValueSetComposeIncludeFilter: BackboneElement { override open class var resourceType: String { get { return "ValueSetComposeIncludeFilter" } } - /// = | is-a | is-not-a | regex | in | not-in | generalizes. - public var op: String? + /// The kind of operation to perform as a part of the filter criteria. + public var op: FilterOperator? /// A property defined by the code system. public var property: String? @@ -755,7 +756,7 @@ open class ValueSetComposeIncludeFilter: BackboneElement { /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(op: String, property: String, value: String) { + public convenience init(op: FilterOperator, property: String, value: String) { self.init() self.op = op self.property = property @@ -768,7 +769,12 @@ open class ValueSetComposeIncludeFilter: BackboneElement { if let exist = json["op"] { presentKeys.insert("op") if let val = exist as? String { - self.op = val + if let enumval = FilterOperator(rawValue: val) { + self.op = enumval + } + else { + errors.append(FHIRValidationError(key: "op", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "op", wants: String.self, has: type(of: exist))) @@ -808,7 +814,7 @@ open class ValueSetComposeIncludeFilter: BackboneElement { var json = super.asJSON(errors: &errors) if let op = self.op { - json["op"] = op.asJSON() + json["op"] = op.rawValue } if let property = self.property { json["property"] = property.asJSON() @@ -823,11 +829,11 @@ open class ValueSetComposeIncludeFilter: BackboneElement { /** - * Used when the value set is "expanded". - * - * A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This - * element holds the expansion, if it has been performed. - */ +Used when the value set is "expanded". + +A value set can also be "expanded", where the value set is turned into a simple collection of enumerated codes. This +element holds the expansion, if it has been performed. +*/ open class ValueSetExpansion: BackboneElement { override open class var resourceType: String { get { return "ValueSetExpansion" } @@ -963,10 +969,10 @@ open class ValueSetExpansion: BackboneElement { /** - * Codes in the value set. - * - * The codes that are contained in the value set expansion. - */ +Codes in the value set. + +The codes that are contained in the value set expansion. +*/ open class ValueSetExpansionContains: BackboneElement { override open class var resourceType: String { get { return "ValueSetExpansionContains" } @@ -1103,11 +1109,11 @@ open class ValueSetExpansionContains: BackboneElement { /** - * Parameter that controlled the expansion process. - * - * A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to - * check whether the expansion is suitable for a particular purpose, or to pick the correct expansion. - */ +Parameter that controlled the expansion process. + +A parameter that controlled the expansion process. These parameters may be used by users of expanded value sets to check +whether the expansion is suitable for a particular purpose, or to pick the correct expansion. +*/ open class ValueSetExpansionParameter: BackboneElement { override open class var resourceType: String { get { return "ValueSetExpansionParameter" } diff --git a/Sources/Models/VisionPrescription.swift b/Sources/Models/VisionPrescription.swift index bb3a4853..0def3027 100644 --- a/Sources/Models/VisionPrescription.swift +++ b/Sources/Models/VisionPrescription.swift @@ -2,7 +2,7 @@ // VisionPrescription.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 (http://hl7.org/fhir/StructureDefinition/VisionPrescription) on 2016-11-03. +// Generated from FHIR 1.7.0.10127 (http://hl7.org/fhir/StructureDefinition/VisionPrescription) on 2016-11-04. // 2016, SMART Health IT. // @@ -10,10 +10,10 @@ import Foundation /** - * Prescription for vision correction products for a patient. - * - * An authorization for the supply of glasses and/or contact lenses to a patient. - */ +Prescription for vision correction products for a patient. + +An authorization for the supply of glasses and/or contact lenses to a patient. +*/ open class VisionPrescription: DomainResource { override open class var resourceType: String { get { return "VisionPrescription" } @@ -43,12 +43,12 @@ open class VisionPrescription: DomainResource { /// Reason or indication for writing the prescription. public var reasonReference: Reference? - /// active | cancelled | draft | entered-in-error. - public var status: String? + /// The status of the resource instance. + public var status: VisionStatus? /** Convenience initializer, taking all required properties as arguments. */ - public convenience init(status: String) { + public convenience init(status: VisionStatus) { self.init() self.status = status } @@ -166,7 +166,12 @@ open class VisionPrescription: DomainResource { if let exist = json["status"] { presentKeys.insert("status") if let val = exist as? String { - self.status = val + if let enumval = VisionStatus(rawValue: val) { + self.status = enumval + } + else { + errors.append(FHIRValidationError(key: "status", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "status", wants: String.self, has: type(of: exist))) @@ -206,7 +211,7 @@ open class VisionPrescription: DomainResource { json["reasonReference"] = reasonReference.asJSON(errors: &errors) } if let status = self.status { - json["status"] = status.asJSON() + json["status"] = status.rawValue } return json @@ -215,10 +220,10 @@ open class VisionPrescription: DomainResource { /** - * Vision supply authorization. - * - * Deals with details of the dispense part of the supply specification. - */ +Vision supply authorization. + +Deals with details of the dispense part of the supply specification. +*/ open class VisionPrescriptionDispense: BackboneElement { override open class var resourceType: String { get { return "VisionPrescriptionDispense" } @@ -233,8 +238,8 @@ open class VisionPrescriptionDispense: BackboneElement { /// Contact lens back curvature. public var backCurve: NSDecimalNumber? - /// up | down | in | out. - public var base: String? + /// The relative base, or reference lens edge, for the prism. + public var base: VisionBase? /// Brand required. public var brand: String? @@ -251,8 +256,8 @@ open class VisionPrescriptionDispense: BackboneElement { /// Lens wear duration. public var duration: Quantity? - /// right | left. - public var eye: String? + /// The eye for which the lens applies. + public var eye: VisionEyes? /// Notes for coatings. public var notes: String? @@ -309,7 +314,12 @@ open class VisionPrescriptionDispense: BackboneElement { if let exist = json["base"] { presentKeys.insert("base") if let val = exist as? String { - self.base = val + if let enumval = VisionBase(rawValue: val) { + self.base = enumval + } + else { + errors.append(FHIRValidationError(key: "base", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "base", wants: String.self, has: type(of: exist))) @@ -368,7 +378,12 @@ open class VisionPrescriptionDispense: BackboneElement { if let exist = json["eye"] { presentKeys.insert("eye") if let val = exist as? String { - self.eye = val + if let enumval = VisionEyes(rawValue: val) { + self.eye = enumval + } + else { + errors.append(FHIRValidationError(key: "eye", problem: "the value “\(val)” is not valid")) + } } else { errors.append(FHIRValidationError(key: "eye", wants: String.self, has: type(of: exist))) @@ -443,7 +458,7 @@ open class VisionPrescriptionDispense: BackboneElement { json["backCurve"] = backCurve.asJSON() } if let base = self.base { - json["base"] = base.asJSON() + json["base"] = base.rawValue } if let brand = self.brand { json["brand"] = brand.asJSON() @@ -461,7 +476,7 @@ open class VisionPrescriptionDispense: BackboneElement { json["duration"] = duration.asJSON(errors: &errors) } if let eye = self.eye { - json["eye"] = eye.asJSON() + json["eye"] = eye.rawValue } if let notes = self.notes { json["notes"] = notes.asJSON() diff --git a/SwiftFHIR.xcodeproj/project.pbxproj b/SwiftFHIR.xcodeproj/project.pbxproj index 1d83cd1e..603b8885 100644 --- a/SwiftFHIR.xcodeproj/project.pbxproj +++ b/SwiftFHIR.xcodeproj/project.pbxproj @@ -448,6 +448,8 @@ EE31DC7F1D64AC6300B04BEA /* UsageContext.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE31DC691D64AC6200B04BEA /* UsageContext.swift */; }; EE39069F1CD3E4F6008FECEA /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE39069E1CD3E4F6008FECEA /* RequestTests.swift */; }; EE3906A01CD3E4F6008FECEA /* RequestTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE39069E1CD3E4F6008FECEA /* RequestTests.swift */; }; + EE4EE4AD1DCCE969005F8CEB /* CodeSystems.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE4EE4AC1DCCE969005F8CEB /* CodeSystems.swift */; }; + EE4EE4AE1DCCE969005F8CEB /* CodeSystems.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE4EE4AC1DCCE969005F8CEB /* CodeSystems.swift */; }; EE545F3B1A66805600E17B0C /* SwiftFHIR.framework in Frameworks */ = {isa = PBXBuildFile; fileRef = EE684C1E19A789BA00B5A2C0 /* SwiftFHIR.framework */; }; EE65DB481CB39FE100E25C72 /* CareTeamTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE6C88E11CB39D0900ADFF94 /* CareTeamTests.swift */; }; EE65DB491CB39FE100E25C72 /* CodeSystemTests.swift in Sources */ = {isa = PBXBuildFile; fileRef = EE6C88E21CB39D0900ADFF94 /* CodeSystemTests.swift */; }; @@ -821,6 +823,7 @@ EE31DC671D64AC6200B04BEA /* PlanDefinition.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = PlanDefinition.swift; sourceTree = ""; }; EE31DC691D64AC6200B04BEA /* UsageContext.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = UsageContext.swift; sourceTree = ""; }; EE39069E1CD3E4F6008FECEA /* RequestTests.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = RequestTests.swift; sourceTree = ""; }; + EE4EE4AC1DCCE969005F8CEB /* CodeSystems.swift */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.swift; path = CodeSystems.swift; sourceTree = ""; }; EE684C1E19A789BA00B5A2C0 /* SwiftFHIR.framework */ = {isa = PBXFileReference; explicitFileType = wrapper.framework; includeInIndex = 0; path = SwiftFHIR.framework; sourceTree = BUILT_PRODUCTS_DIR; }; EE684C2919A789BA00B5A2C0 /* SwiftFHIR-macOSTests.xctest */ = {isa = PBXFileReference; explicitFileType = wrapper.cfbundle; includeInIndex = 0; path = "SwiftFHIR-macOSTests.xctest"; sourceTree = BUILT_PRODUCTS_DIR; }; EE684C2C19A789BA00B5A2C0 /* Info.plist */ = {isa = PBXFileReference; lastKnownFileType = text.plist.xml; path = Info.plist; sourceTree = ""; }; @@ -1006,6 +1009,7 @@ EE02F59F1ACF252000179969 /* ClinicalImpression.swift */, EE02F5A01ACF252000179969 /* CodeableConcept.swift */, EE6C88B31CB39A6A00ADFF94 /* CodeSystem.swift */, + EE4EE4AC1DCCE969005F8CEB /* CodeSystems.swift */, EE02F5A11ACF252000179969 /* Coding.swift */, EE02F5A21ACF252000179969 /* Communication.swift */, EE02F5A31ACF252000179969 /* CommunicationRequest.swift */, @@ -1611,6 +1615,7 @@ EE02F6811ACF252000179969 /* Location.swift in Sources */, EE1310BB1C1B435300D9DAE7 /* FHIRAbstractBase+Factory.swift in Sources */, EE02F60D1ACF252000179969 /* AppointmentResponse.swift in Sources */, + EE4EE4AD1DCCE969005F8CEB /* CodeSystems.swift in Sources */, EE723F751DC148C200C398BA /* ServiceDefinition.swift in Sources */, EE31DC6C1D64AC6300B04BEA /* Consent.swift in Sources */, EE02F67D1ACF252000179969 /* ImmunizationRecommendation.swift in Sources */, @@ -1909,6 +1914,7 @@ EE02F6561ACF252000179969 /* Duration.swift in Sources */, EE02F6821ACF252000179969 /* Location.swift in Sources */, EE1310C31C1B542100D9DAE7 /* FHIRAbstractBase+Factory.swift in Sources */, + EE4EE4AE1DCCE969005F8CEB /* CodeSystems.swift in Sources */, EE31DC6D1D64AC6300B04BEA /* Consent.swift in Sources */, EE02F60E1ACF252000179969 /* AppointmentResponse.swift in Sources */, EE02F67E1ACF252000179969 /* ImmunizationRecommendation.swift in Sources */, diff --git a/TestResources/ReferenceBundled.json b/TestResources/ReferenceBundled.json index da4bc00a..1e798580 100644 --- a/TestResources/ReferenceBundled.json +++ b/TestResources/ReferenceBundled.json @@ -44,7 +44,7 @@ "reference": "Patient/23" }, "code": {}, - "status": "active", + "status": "final", "comment": "Observation 123, referencing subject relatively" } }, @@ -57,7 +57,7 @@ "reference": "urn:uuid:04121321-4af5-424c-a0e1-ed3aab1c349d" }, "code": {}, - "status": "active", + "status": "final", "comment": "Observation 56, referencing subject via UUID" } }, @@ -70,7 +70,7 @@ "reference": "https://fhir.smarthealthit.org/dev/Patient/99" }, "code": {}, - "status": "active", + "status": "final", "comment": "Observation 34 with absolute subject reference to different endpoint" } } diff --git a/TestResources/ValidationMissing.json b/TestResources/ValidationMissing.json index c663a981..71d28aa7 100644 --- a/TestResources/ValidationMissing.json +++ b/TestResources/ValidationMissing.json @@ -14,7 +14,7 @@ }, { "fhir_comments": "invalid “type”", - "type": "invalid" + "type": "date" } ] }, diff --git a/TestResources/ValidationSuperfluousAndWrong.json b/TestResources/ValidationSuperfluousAndWrong.json index 7ea0808a..bbbf2126 100644 --- a/TestResources/ValidationSuperfluousAndWrong.json +++ b/TestResources/ValidationSuperfluousAndWrong.json @@ -3,7 +3,7 @@ "resourceType": "Questionnaire", "id": "questionnaire-superfluous-wrong", "versino": "1.0", - "status": "published", + "status": "punished", "item": [ { "type": "display", diff --git a/Tests/ModelTests/AccountTests.swift b/Tests/ModelTests/AccountTests.swift index 5daa2215..0ddbbc1c 100644 --- a/Tests/ModelTests/AccountTests.swift +++ b/Tests/ModelTests/AccountTests.swift @@ -2,7 +2,7 @@ // AccountTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -52,11 +52,11 @@ class AccountTests: XCTestCase { XCTAssertEqual(inst.identifier?[0].value, "654321") XCTAssertEqual(inst.name, "HACC Funded Billing for Peter James Chalmers") XCTAssertEqual(inst.owner?.reference, "Organization/hl7") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, AccountStatus(rawValue: "active")!) XCTAssertEqual(inst.subject?.display, "Peter James Chalmers") XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.text?.div, "
HACC Funded Billing for Peter James Chalmers
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.text, "patient") return inst diff --git a/Tests/ModelTests/ActivityDefinitionTests.swift b/Tests/ModelTests/ActivityDefinitionTests.swift index 16d46031..c2f8ff20 100644 --- a/Tests/ModelTests/ActivityDefinitionTests.swift +++ b/Tests/ModelTests/ActivityDefinitionTests.swift @@ -2,7 +2,7 @@ // ActivityDefinitionTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -34,14 +34,14 @@ class ActivityDefinitionTests: XCTestCase { func runActivityDefinition1(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.ActivityDefinition { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "activitydefinition-example.json") - XCTAssertEqual(inst.category, "referral") + XCTAssertEqual(inst.category, ActivityDefinitionCategory(rawValue: "referral")!) XCTAssertEqual(inst.code?.coding?[0].code, "306206005") XCTAssertEqual(inst.description_fhir, "refer to primary care mental-health integrated care program for evaluation and treatment of mental health conditions now") XCTAssertEqual(inst.id, "example") - XCTAssertEqual(inst.participantType?[0], "practitioner") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.participantType?[0], PlanActionParticipantType(rawValue: "practitioner")!) + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) XCTAssertEqual(inst.text?.div, "
Referral definition
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/AllergyIntoleranceTests.swift b/Tests/ModelTests/AllergyIntoleranceTests.swift index 5b3cf559..5de5e2ce 100644 --- a/Tests/ModelTests/AllergyIntoleranceTests.swift +++ b/Tests/ModelTests/AllergyIntoleranceTests.swift @@ -2,7 +2,7 @@ // AllergyIntoleranceTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -35,11 +35,11 @@ class AllergyIntoleranceTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "allergyintolerance-example.json") XCTAssertEqual(inst.attestedDate?.description, "2014-10-09T14:58:00+11:00") - XCTAssertEqual(inst.category?[0], "food") + XCTAssertEqual(inst.category?[0], AllergyIntoleranceCategory(rawValue: "food")!) XCTAssertEqual(inst.code?.coding?[0].code, "227493005") XCTAssertEqual(inst.code?.coding?[0].display, "Cashew nuts") XCTAssertEqual(inst.code?.coding?[0].system?.absoluteString, "http://snomed.info/sct") - XCTAssertEqual(inst.criticality, "high") + XCTAssertEqual(inst.criticality, AllergyIntoleranceCriticality(rawValue: "high")!) XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://acme.com/ids/patients/risks") XCTAssertEqual(inst.identifier?[0].value, "49476534") @@ -47,7 +47,7 @@ class AllergyIntoleranceTests: XCTestCase { XCTAssertEqual(inst.note?[0].text, "The criticality is high becasue of the observed anaphylactic reaction when challenged with cashew extract.") XCTAssertEqual(inst.onset?.description, "2004") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.reaction?[0].certainty, "confirmed") + XCTAssertEqual(inst.reaction?[0].certainty, AllergyIntoleranceCertainty(rawValue: "confirmed")!) XCTAssertEqual(inst.reaction?[0].description_fhir, "Challenge Protocol. Severe reaction to subcutaneous cashew extract. Epinephrine administered") XCTAssertEqual(inst.reaction?[0].exposureRoute?.coding?[0].code, "34206005") XCTAssertEqual(inst.reaction?[0].exposureRoute?.coding?[0].display, "Subcutaneous route") @@ -56,22 +56,22 @@ class AllergyIntoleranceTests: XCTestCase { XCTAssertEqual(inst.reaction?[0].manifestation?[0].coding?[0].display, "Anaphylactic reaction") XCTAssertEqual(inst.reaction?[0].manifestation?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.reaction?[0].onset?.description, "2012-06-12") - XCTAssertEqual(inst.reaction?[0].severity, "severe") + XCTAssertEqual(inst.reaction?[0].severity, AllergyIntoleranceSeverity(rawValue: "severe")!) XCTAssertEqual(inst.reaction?[0].substance?.coding?[0].code, "1160593") XCTAssertEqual(inst.reaction?[0].substance?.coding?[0].display, "cashew nut allergenic extract Injectable Product") XCTAssertEqual(inst.reaction?[0].substance?.coding?[0].system?.absoluteString, "http://www.nlm.nih.gov/research/umls/rxnorm") - XCTAssertEqual(inst.reaction?[1].certainty, "likely") + XCTAssertEqual(inst.reaction?[1].certainty, AllergyIntoleranceCertainty(rawValue: "likely")!) XCTAssertEqual(inst.reaction?[1].manifestation?[0].coding?[0].code, "64305001") XCTAssertEqual(inst.reaction?[1].manifestation?[0].coding?[0].display, "Urticaria") XCTAssertEqual(inst.reaction?[1].manifestation?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.reaction?[1].note?[0].text, "The patient reports that the onset of urticaria was within 15 minutes of eating cashews.") XCTAssertEqual(inst.reaction?[1].onset?.description, "2004") - XCTAssertEqual(inst.reaction?[1].severity, "moderate") + XCTAssertEqual(inst.reaction?[1].severity, AllergyIntoleranceSeverity(rawValue: "moderate")!) XCTAssertEqual(inst.recorder?.reference, "Practitioner/example") XCTAssertEqual(inst.reporter?.reference, "Patient/example") - XCTAssertEqual(inst.status, "active-confirmed") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.type, "allergy") + XCTAssertEqual(inst.status, AllergyIntoleranceStatus(rawValue: "active-confirmed")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.type, AllergyIntoleranceType(rawValue: "allergy")!) return inst } diff --git a/Tests/ModelTests/AppointmentResponseTests.swift b/Tests/ModelTests/AppointmentResponseTests.swift index 192f7c8e..e2d416c8 100644 --- a/Tests/ModelTests/AppointmentResponseTests.swift +++ b/Tests/ModelTests/AppointmentResponseTests.swift @@ -2,7 +2,7 @@ // AppointmentResponseTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -43,12 +43,12 @@ class AppointmentResponseTests: XCTestCase { XCTAssertEqual(inst.id, "exampleresp") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://example.org/sampleappointmentresponse-identifier") XCTAssertEqual(inst.identifier?[0].value, "response123") - XCTAssertEqual(inst.participantStatus, "tentative") + XCTAssertEqual(inst.participantStatus, ParticipationStatus(rawValue: "tentative")!) XCTAssertEqual(inst.participantType?[0].coding?[0].code, "ATND") XCTAssertEqual(inst.participantType?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") XCTAssertEqual(inst.start?.description, "2013-12-25T13:15:00Z") XCTAssertEqual(inst.text?.div, "
Accept Brian MRI results discussion
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -72,9 +72,9 @@ class AppointmentResponseTests: XCTestCase { XCTAssertEqual(inst.appointment?.display, "Brian MRI results discussion") XCTAssertEqual(inst.appointment?.reference, "Appointment/example") XCTAssertEqual(inst.id, "example") - XCTAssertEqual(inst.participantStatus, "accepted") + XCTAssertEqual(inst.participantStatus, ParticipationStatus(rawValue: "accepted")!) XCTAssertEqual(inst.text?.div, "
Accept Brian MRI results discussion
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/AppointmentTests.swift b/Tests/ModelTests/AppointmentTests.swift index 9af0e9f7..3cb3e4e0 100644 --- a/Tests/ModelTests/AppointmentTests.swift +++ b/Tests/ModelTests/AppointmentTests.swift @@ -2,7 +2,7 @@ // AppointmentTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -46,16 +46,16 @@ class AppointmentTests: XCTestCase { XCTAssertEqual(inst.minutesDuration, UInt(15)) XCTAssertEqual(inst.participant?[0].actor?.display, "Peter James Chalmers") XCTAssertEqual(inst.participant?[0].actor?.reference, "Patient/example") - XCTAssertEqual(inst.participant?[0].required, "required") - XCTAssertEqual(inst.participant?[0].status, "needs-action") - XCTAssertEqual(inst.participant?[1].required, "required") - XCTAssertEqual(inst.participant?[1].status, "needs-action") + XCTAssertEqual(inst.participant?[0].required, ParticipantRequired(rawValue: "required")!) + XCTAssertEqual(inst.participant?[0].status, ParticipationStatus(rawValue: "needs-action")!) + XCTAssertEqual(inst.participant?[1].required, ParticipantRequired(rawValue: "required")!) + XCTAssertEqual(inst.participant?[1].status, ParticipationStatus(rawValue: "needs-action")!) XCTAssertEqual(inst.participant?[1].type?[0].coding?[0].code, "ATND") XCTAssertEqual(inst.participant?[1].type?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") XCTAssertEqual(inst.participant?[2].actor?.display, "South Wing, second floor") XCTAssertEqual(inst.participant?[2].actor?.reference, "Location/1") - XCTAssertEqual(inst.participant?[2].required, "required") - XCTAssertEqual(inst.participant?[2].status, "accepted") + XCTAssertEqual(inst.participant?[2].required, ParticipantRequired(rawValue: "required")!) + XCTAssertEqual(inst.participant?[2].status, ParticipationStatus(rawValue: "accepted")!) XCTAssertEqual(inst.priority, UInt(5)) XCTAssertEqual(inst.reason?.coding?[0].code, "413095006") XCTAssertEqual(inst.reason?.coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -69,9 +69,9 @@ class AppointmentTests: XCTestCase { XCTAssertEqual(inst.specialty?[0].coding?[0].code, "gp") XCTAssertEqual(inst.specialty?[0].coding?[0].display, "General Practice") XCTAssertEqual(inst.specialty?[0].coding?[0].system?.absoluteString, "http://example.org/specialty") - XCTAssertEqual(inst.status, "proposed") + XCTAssertEqual(inst.status, AppointmentStatus(rawValue: "proposed")!) XCTAssertEqual(inst.text?.div, "
Brian MRI results discussion
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -100,18 +100,18 @@ class AppointmentTests: XCTestCase { XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.participant?[0].actor?.display, "Peter James Chalmers") XCTAssertEqual(inst.participant?[0].actor?.reference, "Patient/example") - XCTAssertEqual(inst.participant?[0].required, "required") - XCTAssertEqual(inst.participant?[0].status, "accepted") + XCTAssertEqual(inst.participant?[0].required, ParticipantRequired(rawValue: "required")!) + XCTAssertEqual(inst.participant?[0].status, ParticipationStatus(rawValue: "accepted")!) XCTAssertEqual(inst.participant?[1].actor?.display, "Dr Adam Careful") XCTAssertEqual(inst.participant?[1].actor?.reference, "Practitioner/example") - XCTAssertEqual(inst.participant?[1].required, "required") - XCTAssertEqual(inst.participant?[1].status, "accepted") + XCTAssertEqual(inst.participant?[1].required, ParticipantRequired(rawValue: "required")!) + XCTAssertEqual(inst.participant?[1].status, ParticipationStatus(rawValue: "accepted")!) XCTAssertEqual(inst.participant?[1].type?[0].coding?[0].code, "ATND") XCTAssertEqual(inst.participant?[1].type?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") XCTAssertEqual(inst.participant?[2].actor?.display, "South Wing, second floor") XCTAssertEqual(inst.participant?[2].actor?.reference, "Location/1") - XCTAssertEqual(inst.participant?[2].required, "required") - XCTAssertEqual(inst.participant?[2].status, "accepted") + XCTAssertEqual(inst.participant?[2].required, ParticipantRequired(rawValue: "required")!) + XCTAssertEqual(inst.participant?[2].status, ParticipationStatus(rawValue: "accepted")!) XCTAssertEqual(inst.priority, UInt(5)) XCTAssertEqual(inst.serviceCategory?.coding?[0].code, "gp") XCTAssertEqual(inst.serviceCategory?.coding?[0].display, "General Practice") @@ -122,9 +122,9 @@ class AppointmentTests: XCTestCase { XCTAssertEqual(inst.specialty?[0].coding?[0].display, "General Practice") XCTAssertEqual(inst.specialty?[0].coding?[0].system?.absoluteString, "http://example.org/specialty") XCTAssertEqual(inst.start?.description, "2013-12-10T09:00:00Z") - XCTAssertEqual(inst.status, "booked") + XCTAssertEqual(inst.status, AppointmentStatus(rawValue: "booked")!) XCTAssertEqual(inst.text?.div, "
Brian MRI results discussion
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -152,19 +152,19 @@ class AppointmentTests: XCTestCase { XCTAssertEqual(inst.id, "2docs") XCTAssertEqual(inst.participant?[0].actor?.display, "Peter James Chalmers") XCTAssertEqual(inst.participant?[0].actor?.reference, "Patient/example") - XCTAssertEqual(inst.participant?[0].required, "information-only") - XCTAssertEqual(inst.participant?[0].status, "accepted") + XCTAssertEqual(inst.participant?[0].required, ParticipantRequired(rawValue: "information-only")!) + XCTAssertEqual(inst.participant?[0].status, ParticipationStatus(rawValue: "accepted")!) XCTAssertEqual(inst.participant?[1].actor?.display, "Dr Adam Careful") XCTAssertEqual(inst.participant?[1].actor?.reference, "Practitioner/example") - XCTAssertEqual(inst.participant?[1].required, "required") - XCTAssertEqual(inst.participant?[1].status, "accepted") + XCTAssertEqual(inst.participant?[1].required, ParticipantRequired(rawValue: "required")!) + XCTAssertEqual(inst.participant?[1].status, ParticipationStatus(rawValue: "accepted")!) XCTAssertEqual(inst.participant?[2].actor?.display, "Luigi Maas") XCTAssertEqual(inst.participant?[2].actor?.reference, "Practitioner/f202") - XCTAssertEqual(inst.participant?[2].required, "required") - XCTAssertEqual(inst.participant?[2].status, "accepted") + XCTAssertEqual(inst.participant?[2].required, ParticipantRequired(rawValue: "required")!) + XCTAssertEqual(inst.participant?[2].status, ParticipationStatus(rawValue: "accepted")!) XCTAssertEqual(inst.participant?[3].actor?.display, "Phone Call") - XCTAssertEqual(inst.participant?[3].required, "information-only") - XCTAssertEqual(inst.participant?[3].status, "accepted") + XCTAssertEqual(inst.participant?[3].required, ParticipantRequired(rawValue: "information-only")!) + XCTAssertEqual(inst.participant?[3].status, ParticipationStatus(rawValue: "accepted")!) XCTAssertEqual(inst.priority, UInt(5)) XCTAssertEqual(inst.serviceCategory?.coding?[0].code, "gp") XCTAssertEqual(inst.serviceCategory?.coding?[0].display, "General Practice") @@ -175,9 +175,9 @@ class AppointmentTests: XCTestCase { XCTAssertEqual(inst.specialty?[0].coding?[0].display, "General Practice") XCTAssertEqual(inst.specialty?[0].coding?[0].system?.absoluteString, "http://example.org/specialty") XCTAssertEqual(inst.start?.description, "2013-12-09T09:00:00Z") - XCTAssertEqual(inst.status, "booked") + XCTAssertEqual(inst.status, AppointmentStatus(rawValue: "booked")!) XCTAssertEqual(inst.text?.div, "
Brian MRI results discussion
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/AuditEventTests.swift b/Tests/ModelTests/AuditEventTests.swift index ea0df7da..a24c508d 100644 --- a/Tests/ModelTests/AuditEventTests.swift +++ b/Tests/ModelTests/AuditEventTests.swift @@ -2,7 +2,7 @@ // AuditEventTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -34,7 +34,7 @@ class AuditEventTests: XCTestCase { func runAuditEvent1(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.AuditEvent { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "audit-event-example-login.json") - XCTAssertEqual(inst.action, "E") + XCTAssertEqual(inst.action, AuditEventAction(rawValue: "E")!) XCTAssertEqual(inst.agent?[0].altId, "601847123") XCTAssertEqual(inst.agent?[0].name, "Grahame Grieve") XCTAssertEqual(inst.agent?[0].network?.address, "127.0.0.1") @@ -60,7 +60,7 @@ class AuditEventTests: XCTestCase { XCTAssertEqual(inst.subtype?[0].code, "110122") XCTAssertEqual(inst.subtype?[0].display, "Login") XCTAssertEqual(inst.subtype?[0].system?.absoluteString, "http://nema.org/dicom/dicm") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "110114") XCTAssertEqual(inst.type?.display, "User Authentication") XCTAssertEqual(inst.type?.system?.absoluteString, "http://nema.org/dicom/dicm") @@ -82,7 +82,7 @@ class AuditEventTests: XCTestCase { func runAuditEvent2(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.AuditEvent { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "audit-event-example-logout.json") - XCTAssertEqual(inst.action, "E") + XCTAssertEqual(inst.action, AuditEventAction(rawValue: "E")!) XCTAssertEqual(inst.agent?[0].altId, "601847123") XCTAssertEqual(inst.agent?[0].name, "Grahame Grieve") XCTAssertEqual(inst.agent?[0].network?.address, "127.0.0.1") @@ -108,7 +108,7 @@ class AuditEventTests: XCTestCase { XCTAssertEqual(inst.subtype?[0].code, "110123") XCTAssertEqual(inst.subtype?[0].display, "Logout") XCTAssertEqual(inst.subtype?[0].system?.absoluteString, "http://nema.org/dicom/dicm") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "110114") XCTAssertEqual(inst.type?.display, "User Authentication") XCTAssertEqual(inst.type?.system?.absoluteString, "http://nema.org/dicom/dicm") @@ -130,7 +130,7 @@ class AuditEventTests: XCTestCase { func runAuditEvent3(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.AuditEvent { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "audit-event-example-media.json") - XCTAssertEqual(inst.action, "R") + XCTAssertEqual(inst.action, AuditEventAction(rawValue: "R")!) XCTAssertFalse(inst.agent?[0].requestor ?? true) XCTAssertEqual(inst.agent?[0].role?[0].coding?[0].code, "110153") XCTAssertEqual(inst.agent?[0].role?[0].coding?[0].display, "Source Role ID") @@ -173,7 +173,7 @@ class AuditEventTests: XCTestCase { XCTAssertEqual(inst.subtype?[0].code, "ITI-32") XCTAssertEqual(inst.subtype?[0].display, "Distribute Document Set on Media") XCTAssertEqual(inst.subtype?[0].system?.absoluteString, "urn:oid:1.3.6.1.4.1.19376.1.2") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "110106") XCTAssertEqual(inst.type?.display, "Export") XCTAssertEqual(inst.type?.system?.absoluteString, "http://nema.org/dicom/dicm") @@ -195,7 +195,7 @@ class AuditEventTests: XCTestCase { func runAuditEvent4(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.AuditEvent { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "audit-event-example-pixQuery.json") - XCTAssertEqual(inst.action, "E") + XCTAssertEqual(inst.action, AuditEventAction(rawValue: "E")!) XCTAssertEqual(inst.agent?[0].altId, "6580") XCTAssertEqual(inst.agent?[0].network?.address, "Workstation1.ehr.familyclinic.com") XCTAssertEqual(inst.agent?[0].network?.type, "1") @@ -230,7 +230,7 @@ class AuditEventTests: XCTestCase { XCTAssertEqual(inst.subtype?[0].code, "ITI-9") XCTAssertEqual(inst.subtype?[0].display, "PIX Query") XCTAssertEqual(inst.subtype?[0].system?.absoluteString, "urn:oid:1.3.6.1.4.1.19376.1.2") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "110112") XCTAssertEqual(inst.type?.display, "Query") XCTAssertEqual(inst.type?.system?.absoluteString, "http://nema.org/dicom/dicm") @@ -252,7 +252,7 @@ class AuditEventTests: XCTestCase { func runAuditEvent5(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.AuditEvent { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "audit-event-example-search.json") - XCTAssertEqual(inst.action, "E") + XCTAssertEqual(inst.action, AuditEventAction(rawValue: "E")!) XCTAssertEqual(inst.agent?[0].altId, "601847123") XCTAssertEqual(inst.agent?[0].name, "Grahame Grieve") XCTAssertTrue(inst.agent?[0].requestor ?? false) @@ -283,7 +283,7 @@ class AuditEventTests: XCTestCase { XCTAssertEqual(inst.subtype?[0].code, "search") XCTAssertEqual(inst.subtype?[0].display, "search") XCTAssertEqual(inst.subtype?[0].system?.absoluteString, "http://hl7.org/fhir/restful-interaction") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "rest") XCTAssertEqual(inst.type?.display, "Restful Operation") XCTAssertEqual(inst.type?.system?.absoluteString, "http://hl7.org/fhir/audit-event-type") @@ -305,7 +305,7 @@ class AuditEventTests: XCTestCase { func runAuditEvent6(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.AuditEvent { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "audit-event-example-vread.json") - XCTAssertEqual(inst.action, "R") + XCTAssertEqual(inst.action, AuditEventAction(rawValue: "R")!) XCTAssertEqual(inst.agent?[0].altId, "601847123") XCTAssertEqual(inst.agent?[0].name, "Grahame Grieve") XCTAssertTrue(inst.agent?[0].requestor ?? false) @@ -336,7 +336,7 @@ class AuditEventTests: XCTestCase { XCTAssertEqual(inst.subtype?[0].code, "vread") XCTAssertEqual(inst.subtype?[0].display, "vread") XCTAssertEqual(inst.subtype?[0].system?.absoluteString, "http://hl7.org/fhir/restful-interaction") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "rest") XCTAssertEqual(inst.type?.display, "Restful Operation") XCTAssertEqual(inst.type?.system?.absoluteString, "http://hl7.org/fhir/audit-event-type") @@ -358,7 +358,7 @@ class AuditEventTests: XCTestCase { func runAuditEvent7(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.AuditEvent { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "auditevent-example-disclosure.json") - XCTAssertEqual(inst.action, "R") + XCTAssertEqual(inst.action, AuditEventAction(rawValue: "R")!) XCTAssertEqual(inst.agent?[0].altId, "notMe") XCTAssertEqual(inst.agent?[0].location?.reference, "Location/1") XCTAssertEqual(inst.agent?[0].name, "That guy everyone wishes would be caught") @@ -425,7 +425,7 @@ class AuditEventTests: XCTestCase { XCTAssertEqual(inst.subtype?[0].code, "Disclosure") XCTAssertEqual(inst.subtype?[0].display, "HIPAA disclosure") XCTAssertEqual(inst.text?.div, "
Disclosure by some idiot, for marketing reasons, to places unknown, of a Poor Sap, data about Everthing important.
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "110106") XCTAssertEqual(inst.type?.display, "Export") XCTAssertEqual(inst.type?.system?.absoluteString, "http://nema.org/dicom/dicm") @@ -447,7 +447,7 @@ class AuditEventTests: XCTestCase { func runAuditEvent8(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.AuditEvent { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "auditevent-example.json") - XCTAssertEqual(inst.action, "E") + XCTAssertEqual(inst.action, AuditEventAction(rawValue: "E")!) XCTAssertEqual(inst.agent?[0].network?.address, "127.0.0.1") XCTAssertEqual(inst.agent?[0].network?.type, "2") XCTAssertFalse(inst.agent?[0].requestor ?? true) @@ -486,7 +486,7 @@ class AuditEventTests: XCTestCase { XCTAssertEqual(inst.subtype?[0].display, "Application Start") XCTAssertEqual(inst.subtype?[0].system?.absoluteString, "http://nema.org/dicom/dicm") XCTAssertEqual(inst.text?.div, "
Application Start for under service login "Grahame" (id: Grahame's Test HL7Connect)
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "110100") XCTAssertEqual(inst.type?.display, "Application Activity") XCTAssertEqual(inst.type?.system?.absoluteString, "http://nema.org/dicom/dicm") diff --git a/Tests/ModelTests/BasicTests.swift b/Tests/ModelTests/BasicTests.swift index bc968fb0..6a619d8e 100644 --- a/Tests/ModelTests/BasicTests.swift +++ b/Tests/ModelTests/BasicTests.swift @@ -2,7 +2,7 @@ // BasicTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -36,7 +36,7 @@ class BasicTests: XCTestCase { XCTAssertEqual(inst.code?.text, "Example Narrative Tester") XCTAssertEqual(inst.id, "basic-example-narrative") - XCTAssertEqual(inst.text?.status, "additional") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "additional")!) return inst } @@ -78,7 +78,7 @@ class BasicTests: XCTestCase { XCTAssertEqual(inst.modifierExtension?[2].valueCode, "complete") XCTAssertEqual(inst.subject?.display, "Roel") XCTAssertEqual(inst.subject?.reference, "Patient/f201") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -117,7 +117,7 @@ class BasicTests: XCTestCase { XCTAssertEqual(inst.extension_fhir?[0].extension_fhir?[2].url?.absoluteString, "attribute") XCTAssertEqual(inst.extension_fhir?[0].url?.absoluteString, "http://example.org/do-not-use/fhir-extensions/UMLclass") XCTAssertEqual(inst.id, "classModel") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/BinaryTests.swift b/Tests/ModelTests/BinaryTests.swift index 13c47abb..65f2f207 100644 --- a/Tests/ModelTests/BinaryTests.swift +++ b/Tests/ModelTests/BinaryTests.swift @@ -2,7 +2,7 @@ // BinaryTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // diff --git a/Tests/ModelTests/BodySiteTests.swift b/Tests/ModelTests/BodySiteTests.swift index b195fa28..b06e3c9b 100644 --- a/Tests/ModelTests/BodySiteTests.swift +++ b/Tests/ModelTests/BodySiteTests.swift @@ -2,7 +2,7 @@ // BodySiteTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -43,7 +43,7 @@ class BodySiteTests: XCTestCase { XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://goodhealth.org/bodysite/identifiers") XCTAssertEqual(inst.identifier?[0].value, "12345") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -71,7 +71,7 @@ class BodySiteTests: XCTestCase { XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://goodhealth.org/bodysite/identifiers") XCTAssertEqual(inst.identifier?[0].value, "12345") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -99,13 +99,13 @@ class BodySiteTests: XCTestCase { XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://goodhealth.org/bodysite/identifiers") XCTAssertEqual(inst.identifier?[0].value, "12345") XCTAssertEqual(inst.image?[0].contentType, "application/dicom") - XCTAssertEqual(inst.image?[0].url?.absoluteString, "http://10.1.2.3:1000/wado?requestType=WADO&wado_details…") +// XCTAssertEqual(inst.image?[0].url?.absoluteString, "http://10.1.2.3:1000/wado?requestType=WADO&wado_details…") XCTAssertEqual(inst.modifier?[0].coding?[0].code, "78961009") XCTAssertEqual(inst.modifier?[0].coding?[0].display, "Splenic structure (body structure)") XCTAssertEqual(inst.modifier?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.modifier?[0].text, "Splenic mass") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/BundleTests.swift b/Tests/ModelTests/BundleTests.swift index b9cdd398..6919f6f6 100644 --- a/Tests/ModelTests/BundleTests.swift +++ b/Tests/ModelTests/BundleTests.swift @@ -2,7 +2,7 @@ // BundleTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -36,11 +36,11 @@ class BundleTests: XCTestCase { XCTAssertEqual(inst.entry?[0].fullUrl?.absoluteString, "https://example.com/base/MedicationRequest/3123") XCTAssertEqual(inst.entry?[0].resource?.id, "3123") - XCTAssertEqual(inst.entry?[0].search?.mode, "match") + XCTAssertEqual(inst.entry?[0].search?.mode, SearchEntryMode(rawValue: "match")!) XCTAssertEqual(inst.entry?[0].search?.score, NSDecimalNumber(string: "1")) XCTAssertEqual(inst.entry?[1].fullUrl?.absoluteString, "https://example.com/base/Medication/example") XCTAssertEqual(inst.entry?[1].resource?.id, "example") - XCTAssertEqual(inst.entry?[1].search?.mode, "include") + XCTAssertEqual(inst.entry?[1].search?.mode, SearchEntryMode(rawValue: "include")!) XCTAssertEqual(inst.id, "bundle-example") XCTAssertEqual(inst.link?[0].relation, "self") XCTAssertEqual(inst.link?[0].url?.absoluteString, "https://example.com/base/MedicationRequest?patient=347&_include=MedicationRequest.medication") @@ -48,7 +48,7 @@ class BundleTests: XCTestCase { XCTAssertEqual(inst.link?[1].url?.absoluteString, "https://example.com/base/MedicationRequest?patient=347&searchId=ff15fd40-ff71-4b48-b366-09c706bed9d0&page=2") XCTAssertEqual(inst.meta?.lastUpdated?.description, "2014-08-18T01:43:30Z") XCTAssertEqual(inst.total, UInt(3)) - XCTAssertEqual(inst.type, "searchset") + XCTAssertEqual(inst.type, BundleType(rawValue: "searchset")!) return inst } @@ -99,7 +99,7 @@ class BundleTests: XCTestCase { XCTAssertEqual(inst.entry?[9].resource?.meta?.lastUpdated?.description, "2012-04-14T10:35:23Z") XCTAssertEqual(inst.id, "72ac8493-52ac-41bd-8d5d-7258c289b5ea") XCTAssertEqual(inst.meta?.lastUpdated?.description, "2012-04-14T10:35:23Z") - XCTAssertEqual(inst.type, "collection") + XCTAssertEqual(inst.type, BundleType(rawValue: "collection")!) return inst } @@ -144,7 +144,7 @@ class BundleTests: XCTestCase { XCTAssertEqual(inst.signature?.type?[0].system?.absoluteString, "http://hl7.org/fhir/valueset-signature-type") XCTAssertEqual(inst.signature?.when?.description, "2015-08-31T07:42:33+10:00") XCTAssertEqual(inst.signature?.whoReference?.reference, "Device/software") - XCTAssertEqual(inst.type, "document") + XCTAssertEqual(inst.type, BundleType(rawValue: "document")!) return inst } @@ -185,7 +185,7 @@ class BundleTests: XCTestCase { XCTAssertEqual(inst.entry?[9].resource?.id, "80") XCTAssertEqual(inst.id, "b0a5e4277-83c4-4adb-87e2-e3efe3369b6f") XCTAssertEqual(inst.meta?.lastUpdated?.description, "2012-05-29T23:45:32Z") - XCTAssertEqual(inst.type, "collection") + XCTAssertEqual(inst.type, BundleType(rawValue: "collection")!) return inst } @@ -236,7 +236,7 @@ class BundleTests: XCTestCase { XCTAssertEqual(inst.entry?[9].resource?.meta?.lastUpdated?.description, "2012-06-03T23:45:32Z") XCTAssertEqual(inst.id, "b0a5e4277-83c4-4adb-87e2-e3efe3369b6f") XCTAssertEqual(inst.meta?.lastUpdated?.description, "2012-05-29T23:45:32Z") - XCTAssertEqual(inst.type, "collection") + XCTAssertEqual(inst.type, BundleType(rawValue: "collection")!) return inst } @@ -287,7 +287,7 @@ class BundleTests: XCTestCase { XCTAssertEqual(inst.entry?[9].resource?.meta?.lastUpdated?.description, "2012-05-29T23:45:32Z") XCTAssertEqual(inst.id, "b248b1b2-1686-4b94-9936-37d7a5f94b51") XCTAssertEqual(inst.meta?.lastUpdated?.description, "2012-05-29T23:45:32Z") - XCTAssertEqual(inst.type, "collection") + XCTAssertEqual(inst.type, BundleType(rawValue: "collection")!) return inst } @@ -338,7 +338,7 @@ class BundleTests: XCTestCase { XCTAssertEqual(inst.entry?[9].resource?.meta?.lastUpdated?.description, "2012-05-29T23:45:32Z") XCTAssertEqual(inst.id, "3ad0687e-f477-468c-afd5-fcc2bf897809") XCTAssertEqual(inst.meta?.lastUpdated?.description, "2012-05-29T23:45:32Z") - XCTAssertEqual(inst.type, "collection") + XCTAssertEqual(inst.type, BundleType(rawValue: "collection")!) return inst } @@ -358,33 +358,33 @@ class BundleTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "xds-example.json") XCTAssertEqual(inst.entry?[0].fullUrl?.absoluteString, "urn:uuid:3fdc72f4-a11d-4a9d-9260-a9f745779e1d") - XCTAssertEqual(inst.entry?[0].request?.method, "POST") + XCTAssertEqual(inst.entry?[0].request?.method, HTTPVerb(rawValue: "POST")!) XCTAssertEqual(inst.entry?[0].request?.url?.absoluteString, "DocumentReference") XCTAssertEqual(inst.entry?[0].resource?.meta?.lastUpdated?.description, "2013-07-01T13:11:33Z") XCTAssertEqual(inst.entry?[1].fullUrl?.absoluteString, "http://localhost:9556/svc/fhir/Patient/a2") XCTAssertEqual(inst.entry?[1].request?.ifNoneExist, "Patient?identifier=http://acme.org/xds/patients!89765a87b") - XCTAssertEqual(inst.entry?[1].request?.method, "POST") + XCTAssertEqual(inst.entry?[1].request?.method, HTTPVerb(rawValue: "POST")!) XCTAssertEqual(inst.entry?[1].request?.url?.absoluteString, "Patient") XCTAssertEqual(inst.entry?[1].resource?.id, "a2") XCTAssertEqual(inst.entry?[1].resource?.meta?.lastUpdated?.description, "2013-07-01T13:11:33Z") XCTAssertEqual(inst.entry?[2].fullUrl?.absoluteString, "http://localhost:9556/svc/fhir/Practitioner/a3") - XCTAssertEqual(inst.entry?[2].request?.method, "POST") + XCTAssertEqual(inst.entry?[2].request?.method, HTTPVerb(rawValue: "POST")!) XCTAssertEqual(inst.entry?[2].request?.url?.absoluteString, "Practitioner") XCTAssertEqual(inst.entry?[2].resource?.id, "a3") XCTAssertEqual(inst.entry?[2].resource?.meta?.lastUpdated?.description, "2013-07-01T13:11:33Z") XCTAssertEqual(inst.entry?[3].fullUrl?.absoluteString, "http://localhost:9556/svc/fhir/Practitioner/a4") - XCTAssertEqual(inst.entry?[3].request?.method, "POST") + XCTAssertEqual(inst.entry?[3].request?.method, HTTPVerb(rawValue: "POST")!) XCTAssertEqual(inst.entry?[3].request?.url?.absoluteString, "Practitioner") XCTAssertEqual(inst.entry?[3].resource?.id, "a4") XCTAssertEqual(inst.entry?[3].resource?.meta?.lastUpdated?.description, "2013-07-01T13:11:33Z") XCTAssertEqual(inst.entry?[4].fullUrl?.absoluteString, "http://localhost:9556/svc/fhir/Binary/1e404af3-077f-4bee-b7a6-a9be97e1ce32") - XCTAssertEqual(inst.entry?[4].request?.method, "POST") + XCTAssertEqual(inst.entry?[4].request?.method, HTTPVerb(rawValue: "POST")!) XCTAssertEqual(inst.entry?[4].request?.url?.absoluteString, "Binary") XCTAssertEqual(inst.entry?[4].resource?.id, "1e404af3-077f-4bee-b7a6-a9be97e1ce32") XCTAssertEqual(inst.entry?[4].resource?.meta?.lastUpdated?.description, "2013-07-01T13:11:33Z") XCTAssertEqual(inst.id, "xds") XCTAssertEqual(inst.meta?.lastUpdated?.description, "2013-07-01T13:11:33Z") - XCTAssertEqual(inst.type, "transaction") + XCTAssertEqual(inst.type, BundleType(rawValue: "transaction")!) return inst } diff --git a/Tests/ModelTests/CapabilityStatementTests.swift b/Tests/ModelTests/CapabilityStatementTests.swift index d4054d94..3cce4e5c 100644 --- a/Tests/ModelTests/CapabilityStatementTests.swift +++ b/Tests/ModelTests/CapabilityStatementTests.swift @@ -2,7 +2,7 @@ // CapabilityStatementTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -34,15 +34,15 @@ class CapabilityStatementTests: XCTestCase { func runCapabilityStatement1(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.CapabilityStatement { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "capabilitystatement-example.json") - XCTAssertEqual(inst.acceptUnknown, "both") + XCTAssertEqual(inst.acceptUnknown, UnknownContentCode(rawValue: "both")!) XCTAssertEqual(inst.contact?[0].name, "System Administrator") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "email") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "email")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "wile@acme.org") XCTAssertEqual(inst.copyright, "Copyright © Acme Healthcare and GoodCorp EHR Systems") XCTAssertEqual(inst.date?.description, "2012-01-04") XCTAssertEqual(inst.description_fhir, "This is the FHIR capability statement for the main EHR at ACME for the private interface - it does not describe the public interface") XCTAssertEqual(inst.document?[0].documentation, "Basic rules for all documents in the EHR system") - XCTAssertEqual(inst.document?[0].mode, "consumer") + XCTAssertEqual(inst.document?[0].mode, DocumentMode(rawValue: "consumer")!) XCTAssertEqual(inst.document?[0].profile?.reference, "http://fhir.hl7.org/base/Profilebc054d23-75e1-4dc6-aca5-838b6b1ac81d/_history/b5fdd9fc-b021-4ea1-911a-721a60663796") XCTAssertTrue(inst.experimental ?? false) XCTAssertEqual(inst.fhirVersion, "1.0.0") @@ -51,17 +51,17 @@ class CapabilityStatementTests: XCTestCase { XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.implementation?.description_fhir, "main EHR at ACME") XCTAssertEqual(inst.implementation?.url?.absoluteString, "http://10.2.3.4/fhir") - XCTAssertEqual(inst.kind, "instance") + XCTAssertEqual(inst.kind, CapabilityStatementKind(rawValue: "instance")!) XCTAssertEqual(inst.messaging?[0].documentation, "ADT A08 equivalent for external system notifications") XCTAssertEqual(inst.messaging?[0].endpoint?[0].address?.absoluteString, "mllp:10.1.1.10:9234") XCTAssertEqual(inst.messaging?[0].endpoint?[0].protocol_fhir?.code, "mllp") XCTAssertEqual(inst.messaging?[0].endpoint?[0].protocol_fhir?.system?.absoluteString, "http://hl7.org/fhir/message-transport") - XCTAssertEqual(inst.messaging?[0].event?[0].category, "Consequence") + XCTAssertEqual(inst.messaging?[0].event?[0].category, MessageSignificanceCategory(rawValue: "Consequence")!) XCTAssertEqual(inst.messaging?[0].event?[0].code?.code, "admin-notify") XCTAssertEqual(inst.messaging?[0].event?[0].code?.system?.absoluteString, "http://hl7.org/fhir/message-type") XCTAssertEqual(inst.messaging?[0].event?[0].documentation, "Notification of an update to a patient resource. changing the links is not supported") XCTAssertEqual(inst.messaging?[0].event?[0].focus, "Patient") - XCTAssertEqual(inst.messaging?[0].event?[0].mode, "receiver") + XCTAssertEqual(inst.messaging?[0].event?[0].mode, EventCapabilityMode(rawValue: "receiver")!) XCTAssertEqual(inst.messaging?[0].event?[0].request?.reference, "StructureDefinition/daf-patient") XCTAssertEqual(inst.messaging?[0].event?[0].response?.reference, "StructureDefinition/MessageHeader") XCTAssertEqual(inst.messaging?[0].reliableCache, UInt(30)) @@ -70,38 +70,38 @@ class CapabilityStatementTests: XCTestCase { XCTAssertEqual(inst.purpose, "Main EHR capability statement, published for contracting and operational support") XCTAssertEqual(inst.rest?[0].compartment?[0].absoluteString, "http://hl7.org/fhir/compartment/Patient") XCTAssertEqual(inst.rest?[0].documentation, "Main FHIR endpoint for acem health") - XCTAssertEqual(inst.rest?[0].interaction?[0].code, "transaction") - XCTAssertEqual(inst.rest?[0].interaction?[1].code, "history-system") - XCTAssertEqual(inst.rest?[0].mode, "server") + XCTAssertEqual(inst.rest?[0].interaction?[0].code, FHIRRestfulInteractions(rawValue: "transaction")!) + XCTAssertEqual(inst.rest?[0].interaction?[1].code, FHIRRestfulInteractions(rawValue: "history-system")!) + XCTAssertEqual(inst.rest?[0].mode, RestfulCapabilityMode(rawValue: "server")!) XCTAssertTrue(inst.rest?[0].resource?[0].conditionalCreate ?? false) - XCTAssertEqual(inst.rest?[0].resource?[0].conditionalDelete, "not-supported") + XCTAssertEqual(inst.rest?[0].resource?[0].conditionalDelete, ConditionalDeleteStatus(rawValue: "not-supported")!) XCTAssertFalse(inst.rest?[0].resource?[0].conditionalUpdate ?? true) - XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[0].code, "read") - XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[1].code, "vread") + XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[0].code, FHIRRestfulInteractions(rawValue: "read")!) + XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[1].code, FHIRRestfulInteractions(rawValue: "vread")!) XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[1].documentation, "Only supported for patient records since 12-Dec 2012") - XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[2].code, "update") - XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[3].code, "history-instance") - XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[4].code, "create") - XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[5].code, "history-type") + XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[2].code, FHIRRestfulInteractions(rawValue: "update")!) + XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[3].code, FHIRRestfulInteractions(rawValue: "history-instance")!) + XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[4].code, FHIRRestfulInteractions(rawValue: "create")!) + XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[5].code, FHIRRestfulInteractions(rawValue: "history-type")!) XCTAssertEqual(inst.rest?[0].resource?[0].profile?.reference, "http://fhir.hl7.org/base/StructureDefinition/7896271d-57f6-4231-89dc-dcc91eab2416") XCTAssertTrue(inst.rest?[0].resource?[0].readHistory ?? false) XCTAssertEqual(inst.rest?[0].resource?[0].searchInclude?[0], "Organization") XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[0].definition?.absoluteString, "http://hl7.org/fhir/SearchParameter/Patient-identifier") XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[0].documentation, "Only supports search by institution MRN") - XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[0].modifier?[0], "missing") + XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[0].modifier?[0], SearchModifierCode(rawValue: "missing")!) XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[0].name, "identifier") - XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[0].type, "token") + XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[0].type, SearchParamType(rawValue: "token")!) XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[1].chain?[0], "name") XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[1].chain?[1], "identifier") XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[1].definition?.absoluteString, "http://hl7.org/fhir/SearchParameter/Patient-careprovider") - XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[1].modifier?[0], "missing") + XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[1].modifier?[0], SearchModifierCode(rawValue: "missing")!) XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[1].name, "careprovider") XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[1].target?[0], "Organization") - XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[1].type, "reference") + XCTAssertEqual(inst.rest?[0].resource?[0].searchParam?[1].type, SearchParamType(rawValue: "reference")!) XCTAssertEqual(inst.rest?[0].resource?[0].searchRevInclude?[0], "Person") XCTAssertEqual(inst.rest?[0].resource?[0].type, "Patient") XCTAssertFalse(inst.rest?[0].resource?[0].updateCreate ?? true) - XCTAssertEqual(inst.rest?[0].resource?[0].versioning, "versioned-update") + XCTAssertEqual(inst.rest?[0].resource?[0].versioning, ResourceVersionPolicy(rawValue: "versioned-update")!) XCTAssertEqual(inst.rest?[0].security?.certificate?[0].blob, Base64Binary(value: "IHRoaXMgYmxvYiBpcyBub3QgdmFsaWQ=")) XCTAssertEqual(inst.rest?[0].security?.certificate?[0].type, "application/jwt") XCTAssertTrue(inst.rest?[0].security?.cors ?? false) @@ -111,8 +111,8 @@ class CapabilityStatementTests: XCTestCase { XCTAssertEqual(inst.software?.name, "EHR") XCTAssertEqual(inst.software?.releaseDate?.description, "2012-01-04") XCTAssertEqual(inst.software?.version, "0.00.020.2134") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "68D043B5-9ECF-4559-A57A-396E0D452311") XCTAssertEqual(inst.version, "20130510") @@ -133,8 +133,8 @@ class CapabilityStatementTests: XCTestCase { func runCapabilityStatement2(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.CapabilityStatement { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "capabilitystatement-phr-example.json") - XCTAssertEqual(inst.acceptUnknown, "no") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "other") + XCTAssertEqual(inst.acceptUnknown, UnknownContentCode(rawValue: "no")!) + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "http://hl7.org/fhir") XCTAssertEqual(inst.date?.description, "2013-06-18") XCTAssertEqual(inst.description_fhir, "Prototype Capability Statement for September 2013 Connectathon") @@ -142,40 +142,40 @@ class CapabilityStatementTests: XCTestCase { XCTAssertEqual(inst.format?[0], "json") XCTAssertEqual(inst.format?[1], "xml") XCTAssertEqual(inst.id, "phr") - XCTAssertEqual(inst.kind, "capability") + XCTAssertEqual(inst.kind, CapabilityStatementKind(rawValue: "capability")!) XCTAssertEqual(inst.name, "PHR Template") XCTAssertEqual(inst.publisher, "FHIR Project") XCTAssertEqual(inst.rest?[0].documentation, "Protoype server Capability Statement for September 2013 Connectathon") - XCTAssertEqual(inst.rest?[0].mode, "server") - XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[0].code, "read") - XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[1].code, "search-type") + XCTAssertEqual(inst.rest?[0].mode, RestfulCapabilityMode(rawValue: "server")!) + XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[0].code, FHIRRestfulInteractions(rawValue: "read")!) + XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[1].code, FHIRRestfulInteractions(rawValue: "search-type")!) XCTAssertEqual(inst.rest?[0].resource?[0].interaction?[1].documentation, "When a client searches patients with no search criteria, they get a list of all patients they have access too. Servers may elect to offer additional search parameters, but this is not required") XCTAssertEqual(inst.rest?[0].resource?[0].type, "Patient") - XCTAssertEqual(inst.rest?[0].resource?[1].interaction?[0].code, "read") - XCTAssertEqual(inst.rest?[0].resource?[1].interaction?[1].code, "search-type") + XCTAssertEqual(inst.rest?[0].resource?[1].interaction?[0].code, FHIRRestfulInteractions(rawValue: "read")!) + XCTAssertEqual(inst.rest?[0].resource?[1].interaction?[1].code, FHIRRestfulInteractions(rawValue: "search-type")!) XCTAssertEqual(inst.rest?[0].resource?[1].searchParam?[0].documentation, "_id parameter always supported. For the connectathon, servers may elect which search parameters are supported") XCTAssertEqual(inst.rest?[0].resource?[1].searchParam?[0].name, "_id") - XCTAssertEqual(inst.rest?[0].resource?[1].searchParam?[0].type, "token") + XCTAssertEqual(inst.rest?[0].resource?[1].searchParam?[0].type, SearchParamType(rawValue: "token")!) XCTAssertEqual(inst.rest?[0].resource?[1].type, "DocumentReference") - XCTAssertEqual(inst.rest?[0].resource?[2].interaction?[0].code, "read") - XCTAssertEqual(inst.rest?[0].resource?[2].interaction?[1].code, "search-type") + XCTAssertEqual(inst.rest?[0].resource?[2].interaction?[0].code, FHIRRestfulInteractions(rawValue: "read")!) + XCTAssertEqual(inst.rest?[0].resource?[2].interaction?[1].code, FHIRRestfulInteractions(rawValue: "search-type")!) XCTAssertEqual(inst.rest?[0].resource?[2].searchParam?[0].documentation, "Standard _id parameter") XCTAssertEqual(inst.rest?[0].resource?[2].searchParam?[0].name, "_id") - XCTAssertEqual(inst.rest?[0].resource?[2].searchParam?[0].type, "token") + XCTAssertEqual(inst.rest?[0].resource?[2].searchParam?[0].type, SearchParamType(rawValue: "token")!) XCTAssertEqual(inst.rest?[0].resource?[2].type, "Condition") - XCTAssertEqual(inst.rest?[0].resource?[3].interaction?[0].code, "read") - XCTAssertEqual(inst.rest?[0].resource?[3].interaction?[1].code, "search-type") + XCTAssertEqual(inst.rest?[0].resource?[3].interaction?[0].code, FHIRRestfulInteractions(rawValue: "read")!) + XCTAssertEqual(inst.rest?[0].resource?[3].interaction?[1].code, FHIRRestfulInteractions(rawValue: "search-type")!) XCTAssertEqual(inst.rest?[0].resource?[3].searchParam?[0].documentation, "Standard _id parameter") XCTAssertEqual(inst.rest?[0].resource?[3].searchParam?[0].name, "_id") - XCTAssertEqual(inst.rest?[0].resource?[3].searchParam?[0].type, "token") + XCTAssertEqual(inst.rest?[0].resource?[3].searchParam?[0].type, SearchParamType(rawValue: "token")!) XCTAssertEqual(inst.rest?[0].resource?[3].searchParam?[1].documentation, "which diagnostic discipline/department created the report") XCTAssertEqual(inst.rest?[0].resource?[3].searchParam?[1].name, "service") - XCTAssertEqual(inst.rest?[0].resource?[3].searchParam?[1].type, "token") + XCTAssertEqual(inst.rest?[0].resource?[3].searchParam?[1].type, SearchParamType(rawValue: "token")!) XCTAssertEqual(inst.rest?[0].resource?[3].type, "DiagnosticReport") XCTAssertEqual(inst.rest?[0].security?.service?[0].text, "OAuth") XCTAssertEqual(inst.software?.name, "ACME PHR Server") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/CarePlanTests.swift b/Tests/ModelTests/CarePlanTests.swift index 9b6f8f52..e6e0288b 100644 --- a/Tests/ModelTests/CarePlanTests.swift +++ b/Tests/ModelTests/CarePlanTests.swift @@ -2,7 +2,7 @@ // CarePlanTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -43,7 +43,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[0].detail?.performer?[0].reference, "Practitioner/f002") XCTAssertTrue(inst.activity?[0].detail?.prohibited ?? false) XCTAssertEqual(inst.activity?[0].detail?.scheduledString, "2011-06-27T09:30:10+01:00") - XCTAssertEqual(inst.activity?[0].detail?.status, "completed") + XCTAssertEqual(inst.activity?[0].detail?.status, CarePlanActivityStatus(rawValue: "completed")!) XCTAssertEqual(inst.addresses?[0].display, "?????") XCTAssertEqual(inst.addresses?[0].reference, "Condition/f201") XCTAssertEqual(inst.careTeam?[0].reference, "#careteam") @@ -52,15 +52,15 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.goal?[0].reference, "#goal") XCTAssertEqual(inst.id, "f001") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://www.bmc.nl/zorgportal/identifiers/careplans") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "CP2903") XCTAssertEqual(inst.modified?.description, "2011-06-27T09:30:10+01:00") XCTAssertEqual(inst.period?.end?.description, "2011-06-27") XCTAssertEqual(inst.period?.start?.description, "2011-06-26") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, CarePlanStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.display, "P. van de Heuvel") XCTAssertEqual(inst.subject?.reference, "Patient/f001") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -88,7 +88,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[0].detail?.performer?[0].reference, "Practitioner/f003") XCTAssertTrue(inst.activity?[0].detail?.prohibited ?? false) XCTAssertEqual(inst.activity?[0].detail?.scheduledString, "2011-07-07T09:30:10+01:00") - XCTAssertEqual(inst.activity?[0].detail?.status, "completed") + XCTAssertEqual(inst.activity?[0].detail?.status, CarePlanActivityStatus(rawValue: "completed")!) XCTAssertEqual(inst.addresses?[0].display, "?????") XCTAssertEqual(inst.addresses?[0].reference, "Condition/f201") XCTAssertEqual(inst.careTeam?[0].reference, "#careteam") @@ -97,15 +97,15 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.goal?[0].reference, "#goal") XCTAssertEqual(inst.id, "f002") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://www.bmc.nl/zorgportal/identifiers/careplans") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "CP2934") XCTAssertEqual(inst.modified?.description, "2011-07-07T09:30:10+01:00") XCTAssertEqual(inst.period?.end?.description, "2013-07-07") XCTAssertEqual(inst.period?.start?.description, "2011-07-06") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, CarePlanStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.display, "P. van de Heuvel") XCTAssertEqual(inst.subject?.reference, "Patient/f001") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -133,7 +133,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[0].detail?.performer?[0].reference, "Practitioner/f001") XCTAssertTrue(inst.activity?[0].detail?.prohibited ?? false) XCTAssertEqual(inst.activity?[0].detail?.scheduledString, "2011-06-27T09:30:10+01:00") - XCTAssertEqual(inst.activity?[0].detail?.status, "completed") + XCTAssertEqual(inst.activity?[0].detail?.status, CarePlanActivityStatus(rawValue: "completed")!) XCTAssertEqual(inst.addresses?[0].display, "?????") XCTAssertEqual(inst.addresses?[0].reference, "Condition/f201") XCTAssertEqual(inst.careTeam?[0].reference, "#careteam") @@ -142,15 +142,15 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.goal?[0].reference, "#goal") XCTAssertEqual(inst.id, "f003") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://www.bmc.nl/zorgportal/identifiers/careplans") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "CP3953") XCTAssertEqual(inst.modified?.description, "2013-06-27T09:30:10+01:00") XCTAssertEqual(inst.period?.end?.description, "2013-03-08T09:30:10+01:00") XCTAssertEqual(inst.period?.start?.description, "2013-03-08T09:00:10+01:00") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, CarePlanStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.display, "P. van de Heuvel") XCTAssertEqual(inst.subject?.reference, "Patient/f001") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -182,14 +182,14 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[0].detail?.productReference?.reference, "Substance/f203") XCTAssertFalse(inst.activity?[0].detail?.prohibited ?? true) XCTAssertEqual(inst.activity?[0].detail?.scheduledString, "daily") - XCTAssertEqual(inst.activity?[0].detail?.status, "completed") + XCTAssertEqual(inst.activity?[0].detail?.status, CarePlanActivityStatus(rawValue: "completed")!) XCTAssertEqual(inst.activity?[1].detail?.category?.coding?[0].code, "observation") XCTAssertEqual(inst.activity?[1].detail?.category?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/care-plan-activity-category") XCTAssertEqual(inst.activity?[1].detail?.code?.coding?[0].code, "306005") XCTAssertEqual(inst.activity?[1].detail?.code?.coding?[0].display, "Echography of kidney") XCTAssertEqual(inst.activity?[1].detail?.code?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertFalse(inst.activity?[1].detail?.prohibited ?? true) - XCTAssertEqual(inst.activity?[1].detail?.status, "completed") + XCTAssertEqual(inst.activity?[1].detail?.status, CarePlanActivityStatus(rawValue: "completed")!) XCTAssertEqual(inst.addresses?[0].display, "Roel's renal insufficiency") XCTAssertEqual(inst.addresses?[0].reference, "Condition/f204") XCTAssertEqual(inst.careTeam?[0].reference, "#careteam") @@ -200,10 +200,10 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.modified?.description, "2013-03-11") XCTAssertEqual(inst.period?.end?.description, "2013-03-13") XCTAssertEqual(inst.period?.start?.description, "2013-03-11") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.status, CarePlanStatus(rawValue: "draft")!) XCTAssertEqual(inst.subject?.display, "Roel") XCTAssertEqual(inst.subject?.reference, "Patient/f201") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -231,7 +231,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[0].detail?.code?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.activity?[0].detail?.productReference?.reference, "#tpf") XCTAssertFalse(inst.activity?[0].detail?.prohibited ?? true) - XCTAssertEqual(inst.activity?[0].detail?.status, "in-progress") + XCTAssertEqual(inst.activity?[0].detail?.status, CarePlanActivityStatus(rawValue: "in-progress")!) XCTAssertEqual(inst.addresses?[0].display, "Roel's head-neck tumor") XCTAssertEqual(inst.addresses?[0].reference, "Condition/f202") XCTAssertEqual(inst.careTeam?[0].reference, "#careteam") @@ -243,10 +243,10 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.contained?[5].id, "goal") XCTAssertEqual(inst.goal?[0].reference, "#goal") XCTAssertEqual(inst.id, "f202") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, CarePlanStatus(rawValue: "active")!) XCTAssertEqual(inst.subject?.display, "Roel") XCTAssertEqual(inst.subject?.reference, "Patient/f201") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -271,7 +271,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[0].detail?.code?.coding?[0].display, "High resolution computed tomography of lungs") XCTAssertEqual(inst.activity?[0].detail?.code?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertFalse(inst.activity?[0].detail?.prohibited ?? true) - XCTAssertEqual(inst.activity?[0].detail?.status, "not-started") + XCTAssertEqual(inst.activity?[0].detail?.status, CarePlanActivityStatus(rawValue: "not-started")!) XCTAssertEqual(inst.addresses?[0].display, "Roel's sepsis") XCTAssertEqual(inst.addresses?[0].reference, "Condition/f203") XCTAssertEqual(inst.careTeam?[0].reference, "#careteam") @@ -282,10 +282,10 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.modified?.description, "2013-03-11") XCTAssertEqual(inst.period?.end?.description, "2013-04-21") XCTAssertEqual(inst.period?.start?.description, "2013-04-14") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, CarePlanStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.display, "Roel") XCTAssertEqual(inst.subject?.reference, "Patient/f201") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -315,7 +315,7 @@ class CarePlanTests: XCTestCase { XCTAssertFalse(inst.activity?[0].detail?.prohibited ?? true) XCTAssertEqual(inst.activity?[0].detail?.scheduledPeriod?.end?.description, "2013-01-01T10:50:00+00:00") XCTAssertEqual(inst.activity?[0].detail?.scheduledPeriod?.start?.description, "2013-01-01T10:38:00+00:00") - XCTAssertEqual(inst.activity?[0].detail?.status, "completed") + XCTAssertEqual(inst.activity?[0].detail?.status, CarePlanActivityStatus(rawValue: "completed")!) XCTAssertEqual(inst.activity?[1].detail?.category?.coding?[0].code, "encounter") XCTAssertEqual(inst.activity?[1].detail?.category?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/care-plan-activity-category") XCTAssertEqual(inst.activity?[1].detail?.code?.coding?[0].code, "doccon") @@ -324,7 +324,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[1].detail?.performer?[0].display, "Doctor Dave") XCTAssertEqual(inst.activity?[1].detail?.performer?[0].reference, "Practitioner/14") XCTAssertFalse(inst.activity?[1].detail?.prohibited ?? true) - XCTAssertEqual(inst.activity?[1].detail?.status, "scheduled") + XCTAssertEqual(inst.activity?[1].detail?.status, CarePlanActivityStatus(rawValue: "scheduled")!) XCTAssertEqual(inst.addresses?[0].display, "obesity") XCTAssertEqual(inst.addresses?[0].reference, "#p1") XCTAssertEqual(inst.careTeam?[0].reference, "#careteam") @@ -334,10 +334,10 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.goal?[0].reference, "#goal") XCTAssertEqual(inst.id, "gpvisit") XCTAssertEqual(inst.period?.start?.description, "2013-01-01T10:30:00+00:00") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, CarePlanStatus(rawValue: "active")!) XCTAssertEqual(inst.subject?.display, "Peter James Chalmers") XCTAssertEqual(inst.subject?.reference, "Patient/100") - XCTAssertEqual(inst.text?.status, "additional") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "additional")!) return inst } @@ -364,7 +364,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[0].detail?.goal?[0].reference, "#g1") XCTAssertFalse(inst.activity?[0].detail?.prohibited ?? true) XCTAssertEqual(inst.activity?[0].detail?.scheduledPeriod?.start?.description, "2012-09-10") - XCTAssertEqual(inst.activity?[0].detail?.status, "not-started") + XCTAssertEqual(inst.activity?[0].detail?.status, CarePlanActivityStatus(rawValue: "not-started")!) XCTAssertEqual(inst.activity?[0].progress?[0].text, "Eve eats one meal a day with her parents") XCTAssertEqual(inst.activity?[0].progress?[0].time?.description, "2012-09-10") XCTAssertEqual(inst.activity?[1].detail?.category?.coding?[0].code, "other") @@ -375,7 +375,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[1].detail?.goal?[0].reference, "#g1") XCTAssertFalse(inst.activity?[1].detail?.prohibited ?? true) XCTAssertEqual(inst.activity?[1].detail?.scheduledPeriod?.start?.description, "2012-09-10") - XCTAssertEqual(inst.activity?[1].detail?.status, "not-started") + XCTAssertEqual(inst.activity?[1].detail?.status, CarePlanActivityStatus(rawValue: "not-started")!) XCTAssertEqual(inst.activity?[1].progress?[0].text, "Eve will sleep in her bed more often than the couch") XCTAssertEqual(inst.activity?[1].progress?[0].time?.description, "2012-09-10") XCTAssertEqual(inst.activity?[2].detail?.category?.coding?[0].code, "other") @@ -386,7 +386,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[2].detail?.goal?[0].reference, "#g2") XCTAssertFalse(inst.activity?[2].detail?.prohibited ?? true) XCTAssertEqual(inst.activity?[2].detail?.scheduledPeriod?.start?.description, "2012-09-10") - XCTAssertEqual(inst.activity?[2].detail?.status, "in-progress") + XCTAssertEqual(inst.activity?[2].detail?.status, CarePlanActivityStatus(rawValue: "in-progress")!) XCTAssertEqual(inst.activity?[3].detail?.category?.coding?[0].code, "other") XCTAssertEqual(inst.activity?[3].detail?.category?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/care-plan-activity-category") XCTAssertEqual(inst.activity?[3].detail?.description_fhir, "Eve will walk her friend's dog up and down a big hill 15-30 minutes 3 days a week") @@ -395,7 +395,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[3].detail?.goal?[0].reference, "#g3") XCTAssertFalse(inst.activity?[3].detail?.prohibited ?? true) XCTAssertEqual(inst.activity?[3].detail?.scheduledPeriod?.start?.description, "2012-08-27") - XCTAssertEqual(inst.activity?[3].detail?.status, "in-progress") + XCTAssertEqual(inst.activity?[3].detail?.status, CarePlanActivityStatus(rawValue: "in-progress")!) XCTAssertEqual(inst.activity?[3].progress?[0].text, "Eve would like to try for 5 days a week.") XCTAssertEqual(inst.activity?[3].progress?[0].time?.description, "2012-08-27") XCTAssertEqual(inst.activity?[3].progress?[1].text, "Eve is still walking the dogs.") @@ -408,7 +408,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[4].detail?.goal?[0].reference, "#g3") XCTAssertFalse(inst.activity?[4].detail?.prohibited ?? true) XCTAssertEqual(inst.activity?[4].detail?.scheduledPeriod?.start?.description, "2012-07-23") - XCTAssertEqual(inst.activity?[4].detail?.status, "in-progress") + XCTAssertEqual(inst.activity?[4].detail?.status, CarePlanActivityStatus(rawValue: "in-progress")!) XCTAssertEqual(inst.activity?[4].progress?[0].text, "Eve walked 4 times the last week.") XCTAssertEqual(inst.activity?[4].progress?[0].time?.description, "2012-08-13") XCTAssertEqual(inst.activity?[4].progress?[1].text, "Eve did not walk to her parents the last week, but has plans to start again") @@ -421,7 +421,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[5].detail?.goal?[0].reference, "#g4") XCTAssertFalse(inst.activity?[5].detail?.prohibited ?? true) XCTAssertEqual(inst.activity?[5].detail?.scheduledPeriod?.start?.description, "2012-07-23") - XCTAssertEqual(inst.activity?[5].detail?.status, "in-progress") + XCTAssertEqual(inst.activity?[5].detail?.status, CarePlanActivityStatus(rawValue: "in-progress")!) XCTAssertEqual(inst.activity?[6].detail?.category?.coding?[0].code, "other") XCTAssertEqual(inst.activity?[6].detail?.category?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/care-plan-activity-category") XCTAssertEqual(inst.activity?[6].detail?.description_fhir, "Eve will use her lights MWF after her shower for 3 minutes") @@ -430,7 +430,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[6].detail?.goal?[0].reference, "#g5") XCTAssertFalse(inst.activity?[6].detail?.prohibited ?? true) XCTAssertEqual(inst.activity?[6].detail?.scheduledPeriod?.start?.description, "2012-07-23") - XCTAssertEqual(inst.activity?[6].detail?.status, "in-progress") + XCTAssertEqual(inst.activity?[6].detail?.status, CarePlanActivityStatus(rawValue: "in-progress")!) XCTAssertEqual(inst.activity?[6].progress?[0].text, "After restarting the vinegar soaks the psoriasis is improved and Eve plans to treat the remainder with light treatments. She plans to start this week.") XCTAssertEqual(inst.activity?[6].progress?[0].time?.description, "2012-08-13") XCTAssertEqual(inst.activity?[6].progress?[1].text, "Since her skin is improved Eve has not been using the light treatment as often, maybe once a week. She would like to increase to 3 times a week again") @@ -443,7 +443,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[7].detail?.goal?[0].reference, "#g4") XCTAssertFalse(inst.activity?[7].detail?.prohibited ?? true) XCTAssertEqual(inst.activity?[7].detail?.scheduledPeriod?.start?.description, "2012-07-10") - XCTAssertEqual(inst.activity?[7].detail?.status, "in-progress") + XCTAssertEqual(inst.activity?[7].detail?.status, CarePlanActivityStatus(rawValue: "in-progress")!) XCTAssertEqual(inst.activity?[7].progress?[0].text, "Eve created a chart as a reminer to take the medications that do not fit in her pill box") XCTAssertEqual(inst.activity?[7].progress?[0].time?.description, "2012-07-23") XCTAssertEqual(inst.activity?[8].detail?.category?.coding?[0].code, "other") @@ -454,7 +454,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[8].detail?.goal?[0].reference, "#g3") XCTAssertFalse(inst.activity?[8].detail?.prohibited ?? true) XCTAssertEqual(inst.activity?[8].detail?.scheduledPeriod?.start?.description, "2012-07-23") - XCTAssertEqual(inst.activity?[8].detail?.status, "on-hold") + XCTAssertEqual(inst.activity?[8].detail?.status, CarePlanActivityStatus(rawValue: "on-hold")!) XCTAssertEqual(inst.activity?[8].progress?[0].text, "Will be able to esume exercise.") XCTAssertEqual(inst.activity?[8].progress?[0].time?.description, "2012-07-30") XCTAssertEqual(inst.activity?[8].progress?[1].text, "Eve prefers to focus on walking at this time") @@ -467,7 +467,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[9].detail?.goal?[0].reference, "#g4") XCTAssertFalse(inst.activity?[9].detail?.prohibited ?? true) XCTAssertEqual(inst.activity?[9].detail?.scheduledPeriod?.start?.description, "2012-07-10") - XCTAssertEqual(inst.activity?[9].detail?.status, "completed") + XCTAssertEqual(inst.activity?[9].detail?.status, CarePlanActivityStatus(rawValue: "completed")!) XCTAssertEqual(inst.addresses?[0].display, "GERDS") XCTAssertEqual(inst.addresses?[0].reference, "#p1") XCTAssertEqual(inst.addresses?[1].display, "Obesity") @@ -490,10 +490,10 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.id, "integrate") XCTAssertEqual(inst.modified?.description, "2012-09-10") XCTAssertEqual(inst.note?.text, "Patient family is not ready to commit to goal setting at this time. Goal setting will be addressed in the future") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, CarePlanStatus(rawValue: "active")!) XCTAssertEqual(inst.subject?.display, "Eve Everywoman") XCTAssertEqual(inst.subject?.reference, "Patient/1") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -523,7 +523,7 @@ class CarePlanTests: XCTestCase { XCTAssertFalse(inst.activity?[0].detail?.prohibited ?? true) XCTAssertEqual(inst.activity?[0].detail?.scheduledTiming?.repeat_fhir?.boundsPeriod?.end?.description, "2013-02-28") XCTAssertEqual(inst.activity?[0].detail?.scheduledTiming?.repeat_fhir?.boundsPeriod?.start?.description, "2013-02-14") - XCTAssertEqual(inst.activity?[0].detail?.status, "scheduled") + XCTAssertEqual(inst.activity?[0].detail?.status, CarePlanActivityStatus(rawValue: "scheduled")!) XCTAssertEqual(inst.activity?[0].extension_fhir?[0].url?.absoluteString, "http://example.org/DoNotUse/careplan#andetails") XCTAssertEqual(inst.activity?[0].extension_fhir?[0].valueUri?.absoluteString, "http://orionhealth.com/fhir/careplan/1andetails") XCTAssertEqual(inst.activity?[1].detail?.category?.coding?[0].code, "encounter") @@ -537,7 +537,7 @@ class CarePlanTests: XCTestCase { XCTAssertFalse(inst.activity?[1].detail?.prohibited ?? true) XCTAssertEqual(inst.activity?[1].detail?.scheduledTiming?.repeat_fhir?.boundsPeriod?.end?.description, "2013-03-14") XCTAssertEqual(inst.activity?[1].detail?.scheduledTiming?.repeat_fhir?.boundsPeriod?.start?.description, "2013-03-01") - XCTAssertEqual(inst.activity?[1].detail?.status, "not-started") + XCTAssertEqual(inst.activity?[1].detail?.status, CarePlanActivityStatus(rawValue: "not-started")!) XCTAssertEqual(inst.activity?[2].detail?.category?.coding?[0].code, "encounter") XCTAssertEqual(inst.activity?[2].detail?.category?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/care-plan-activity-category") XCTAssertEqual(inst.activity?[2].detail?.code?.coding?[0].code, "del") @@ -549,7 +549,7 @@ class CarePlanTests: XCTestCase { XCTAssertFalse(inst.activity?[2].detail?.prohibited ?? true) XCTAssertEqual(inst.activity?[2].detail?.scheduledTiming?.repeat_fhir?.boundsPeriod?.end?.description, "2013-09-14") XCTAssertEqual(inst.activity?[2].detail?.scheduledTiming?.repeat_fhir?.boundsPeriod?.start?.description, "2013-09-01") - XCTAssertEqual(inst.activity?[2].detail?.status, "not-started") + XCTAssertEqual(inst.activity?[2].detail?.status, CarePlanActivityStatus(rawValue: "not-started")!) XCTAssertEqual(inst.addresses?[0].display, "pregnancy") XCTAssertEqual(inst.addresses?[0].reference, "#p1") XCTAssertEqual(inst.careTeam?[0].reference, "#careteam") @@ -564,10 +564,10 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.id, "preg") XCTAssertEqual(inst.period?.end?.description, "2013-10-01") XCTAssertEqual(inst.period?.start?.description, "2013-01-01") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, CarePlanStatus(rawValue: "active")!) XCTAssertEqual(inst.subject?.display, "Eve Everywoman") XCTAssertEqual(inst.subject?.reference, "Patient/1") - XCTAssertEqual(inst.text?.status, "additional") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "additional")!) return inst } @@ -595,6 +595,7 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.activity?[0].detail?.scheduledTiming?.repeat_fhir?.frequency, 1) XCTAssertEqual(inst.activity?[0].detail?.scheduledTiming?.repeat_fhir?.period, NSDecimalNumber(string: "1")) XCTAssertEqual(inst.activity?[0].detail?.scheduledTiming?.repeat_fhir?.periodUnit, "d") + XCTAssertEqual(inst.activity?[0].detail?.status, CarePlanActivityStatus(rawValue: "completed")!) XCTAssertEqual(inst.addresses?[0].display, "obesity") XCTAssertEqual(inst.addresses?[0].reference, "#p1") XCTAssertEqual(inst.careTeam?[0].reference, "CareTeam/example") @@ -603,10 +604,10 @@ class CarePlanTests: XCTestCase { XCTAssertEqual(inst.goal?[0].reference, "#goal") XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.period?.end?.description, "2013-01-01") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, CarePlanStatus(rawValue: "active")!) XCTAssertEqual(inst.subject?.display, "Peter James Chalmers") XCTAssertEqual(inst.subject?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "additional") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "additional")!) return inst } diff --git a/Tests/ModelTests/CareTeamTests.swift b/Tests/ModelTests/CareTeamTests.swift index 1fd3b162..e431d87d 100644 --- a/Tests/ModelTests/CareTeamTests.swift +++ b/Tests/ModelTests/CareTeamTests.swift @@ -2,7 +2,7 @@ // CareTeamTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -46,7 +46,7 @@ class CareTeamTests: XCTestCase { XCTAssertEqual(inst.subject?.display, "Peter James Chalmers") XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.text?.div, "
Care Team
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/ClaimResponseTests.swift b/Tests/ModelTests/ClaimResponseTests.swift index 4930d379..fb37d96a 100644 --- a/Tests/ModelTests/ClaimResponseTests.swift +++ b/Tests/ModelTests/ClaimResponseTests.swift @@ -2,7 +2,7 @@ // ClaimResponseTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -69,9 +69,9 @@ class ClaimResponseTests: XCTestCase { XCTAssertEqual(inst.payment?.type?.code, "complete") XCTAssertEqual(inst.payment?.type?.system?.absoluteString, "http://hl7.org/fhir/ValueSet/ex-paymenttype") XCTAssertEqual(inst.request?.reference, "http://www.BenefitsInc.com/fhir/oralhealthclaim/15476332402") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ClaimResponseStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the ClaimResponse
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.totalBenefit?.code, "USD") XCTAssertEqual(inst.totalBenefit?.system?.absoluteString, "urn:iso:std:iso:4217") XCTAssertEqual(inst.totalBenefit?.value, NSDecimalNumber(string: "100.47")) diff --git a/Tests/ModelTests/ClaimTests.swift b/Tests/ModelTests/ClaimTests.swift index c462d13f..72b2991f 100644 --- a/Tests/ModelTests/ClaimTests.swift +++ b/Tests/ModelTests/ClaimTests.swift @@ -2,7 +2,7 @@ // ClaimTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -63,15 +63,15 @@ class ClaimTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/1") XCTAssertEqual(inst.payee?.type?.code, "provider") XCTAssertEqual(inst.priority?.code, "normal") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ClaimStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Claim
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.total?.code, "USD") XCTAssertEqual(inst.total?.system?.absoluteString, "urn:iso:std:iso:4217") XCTAssertEqual(inst.total?.value, NSDecimalNumber(string: "125.0")) XCTAssertEqual(inst.type?.code, "institutional") XCTAssertEqual(inst.type?.system?.absoluteString, "http://hl7.org/fhir/ex-claimtype") - XCTAssertEqual(inst.use, "complete") + XCTAssertEqual(inst.use, Use(rawValue: "complete")!) return inst } @@ -161,12 +161,12 @@ class ClaimTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/1") XCTAssertEqual(inst.payee?.type?.code, "provider") XCTAssertEqual(inst.priority?.code, "normal") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ClaimStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Oral Health Claim
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "oral") XCTAssertEqual(inst.type?.system?.absoluteString, "http://hl7.org/fhir/ex-claimtype") - XCTAssertEqual(inst.use, "complete") + XCTAssertEqual(inst.use, Use(rawValue: "complete")!) return inst } @@ -213,12 +213,12 @@ class ClaimTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "#patient-1") XCTAssertEqual(inst.payee?.type?.code, "provider") XCTAssertEqual(inst.priority?.code, "normal") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ClaimStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
This example assumes a national health care scheme where patients, providers and organizations have known business identifiers.
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "oral") XCTAssertEqual(inst.type?.system?.absoluteString, "http://hl7.org/fhir/ex-claimtype") - XCTAssertEqual(inst.use, "complete") + XCTAssertEqual(inst.use, Use(rawValue: "complete")!) return inst } @@ -266,12 +266,12 @@ class ClaimTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "#patient-1") XCTAssertEqual(inst.payee?.type?.code, "provider") XCTAssertEqual(inst.priority?.code, "normal") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ClaimStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Oral Health Claim
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "oral") XCTAssertEqual(inst.type?.system?.absoluteString, "http://hl7.org/fhir/ex-claimtype") - XCTAssertEqual(inst.use, "complete") + XCTAssertEqual(inst.use, Use(rawValue: "complete")!) return inst } @@ -319,12 +319,12 @@ class ClaimTests: XCTestCase { XCTAssertEqual(inst.patient?.identifier?.value, "123AB345") XCTAssertEqual(inst.payee?.type?.code, "provider") XCTAssertEqual(inst.priority?.code, "normal") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ClaimStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
This example assumes a national health care scheme where patients, providers and organizations have known business identifiers.
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "oral") XCTAssertEqual(inst.type?.system?.absoluteString, "http://hl7.org/fhir/ex-claimtype") - XCTAssertEqual(inst.use, "complete") + XCTAssertEqual(inst.use, Use(rawValue: "complete")!) return inst } @@ -458,12 +458,12 @@ class ClaimTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/1") XCTAssertEqual(inst.payee?.type?.code, "provider") XCTAssertEqual(inst.priority?.code, "normal") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ClaimStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Oral Health Claim
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "oral") XCTAssertEqual(inst.type?.system?.absoluteString, "http://hl7.org/fhir/ex-claimtype") - XCTAssertEqual(inst.use, "proposed") + XCTAssertEqual(inst.use, Use(rawValue: "proposed")!) return inst } @@ -507,12 +507,12 @@ class ClaimTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/1") XCTAssertEqual(inst.payee?.type?.code, "provider") XCTAssertEqual(inst.priority?.code, "stat") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ClaimStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Pharmacy Claim
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "pharmacy") XCTAssertEqual(inst.type?.system?.absoluteString, "http://hl7.org/fhir/ex-claimtype") - XCTAssertEqual(inst.use, "complete") + XCTAssertEqual(inst.use, Use(rawValue: "complete")!) return inst } @@ -556,12 +556,12 @@ class ClaimTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/1") XCTAssertEqual(inst.payee?.type?.code, "provider") XCTAssertEqual(inst.priority?.code, "normal") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ClaimStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Claim
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "professional") XCTAssertEqual(inst.type?.system?.absoluteString, "http://hl7.org/fhir/ex-claimtype") - XCTAssertEqual(inst.use, "complete") + XCTAssertEqual(inst.use, Use(rawValue: "complete")!) return inst } @@ -635,12 +635,12 @@ class ClaimTests: XCTestCase { XCTAssertEqual(inst.payee?.type?.code, "provider") XCTAssertEqual(inst.prescription?.reference, "http://www.optdocs.com/prescription/12345") XCTAssertEqual(inst.priority?.code, "normal") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ClaimStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Vision Claim for Glasses
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "vision") XCTAssertEqual(inst.type?.system?.absoluteString, "http://hl7.org/fhir/ex-claimtype") - XCTAssertEqual(inst.use, "complete") + XCTAssertEqual(inst.use, Use(rawValue: "complete")!) return inst } @@ -684,12 +684,12 @@ class ClaimTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/1") XCTAssertEqual(inst.payee?.type?.code, "provider") XCTAssertEqual(inst.priority?.code, "normal") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ClaimStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Vision Claim
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "vision") XCTAssertEqual(inst.type?.system?.absoluteString, "http://hl7.org/fhir/ex-claimtype") - XCTAssertEqual(inst.use, "complete") + XCTAssertEqual(inst.use, Use(rawValue: "complete")!) return inst } diff --git a/Tests/ModelTests/ClinicalImpressionTests.swift b/Tests/ModelTests/ClinicalImpressionTests.swift index 2fce7075..3a6a5d94 100644 --- a/Tests/ModelTests/ClinicalImpressionTests.swift +++ b/Tests/ModelTests/ClinicalImpressionTests.swift @@ -2,7 +2,7 @@ // ClinicalImpressionTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -46,10 +46,10 @@ class ClinicalImpressionTests: XCTestCase { XCTAssertEqual(inst.investigation?[0].item?[2].display, "disoriented to time and place") XCTAssertEqual(inst.investigation?[0].item?[3].display, "restless") XCTAssertEqual(inst.problem?[0].display, "MVA") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, ClinicalImpressionStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.summary, "provisional diagnoses of laceration of head and traumatic brain injury (TBI)") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/CodeSystemTests.swift b/Tests/ModelTests/CodeSystemTests.swift index 95126ca2..d6efe141 100644 --- a/Tests/ModelTests/CodeSystemTests.swift +++ b/Tests/ModelTests/CodeSystemTests.swift @@ -2,7 +2,7 @@ // CodeSystemTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -54,9 +54,9 @@ class CodeSystemTests: XCTestCase { XCTAssertEqual(inst.concept?[2].designation?[0].value, "Obdurate Labs uses this with both kinds of units...") XCTAssertEqual(inst.concept?[2].display, "SChol") XCTAssertEqual(inst.contact?[0].name, "FHIR project team") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "http://hl7.org/fhir") - XCTAssertEqual(inst.content, "complete") + XCTAssertEqual(inst.content, CodeSystemContentMode(rawValue: "complete")!) XCTAssertEqual(inst.date?.description, "2016-01-28") XCTAssertEqual(inst.description_fhir, "This is an example code system that includes all the ACME codes for serum/plasma cholesterol from v2.36.") XCTAssertTrue(inst.experimental ?? false) @@ -66,8 +66,8 @@ class CodeSystemTests: XCTestCase { XCTAssertEqual(inst.meta?.profile?[0].absoluteString, "http://hl7.org/fhir/StructureDefinition/codesystem-shareable-definition") XCTAssertEqual(inst.name, "ACME Codes for Cholesterol in Serum/Plasma") XCTAssertEqual(inst.publisher, "HL7 International") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/CodeSystem/example") XCTAssertEqual(inst.version, "20160128") @@ -116,20 +116,20 @@ class CodeSystemTests: XCTestCase { XCTAssertEqual(inst.concept?[8].code, "plans") XCTAssertEqual(inst.concept?[8].definition, "A set of care plans that apply in a particular context of care.") XCTAssertEqual(inst.concept?[8].display, "Care Plans") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "http://hl7.org/fhir") - XCTAssertEqual(inst.content, "complete") + XCTAssertEqual(inst.content, CodeSystemContentMode(rawValue: "complete")!) XCTAssertEqual(inst.description_fhir, "Example use codes for the List resource - typical kinds of use.") XCTAssertTrue(inst.experimental ?? false) XCTAssertEqual(inst.id, "list-example-codes") XCTAssertEqual(inst.identifier?.system?.absoluteString, "urn:ietf:rfc:3986") XCTAssertEqual(inst.identifier?.value, "urn:oid:2.16.840.1.113883.4.642.1.173") - XCTAssertEqual(inst.meta?.lastUpdated?.description, "2016-11-01T13:32:59.924+00:00") + XCTAssertEqual(inst.meta?.lastUpdated?.description, "2016-11-04T22:07:34.007+00:00") XCTAssertEqual(inst.meta?.profile?[0].absoluteString, "http://hl7.org/fhir/StructureDefinition/codesystem-shareable-definition") XCTAssertEqual(inst.name, "Example Use Codes for List") XCTAssertEqual(inst.publisher, "FHIR Project") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/list-example-use-codes") XCTAssertEqual(inst.valueSet?.absoluteString, "http://hl7.org/fhir/ValueSet/list-example-codes") XCTAssertEqual(inst.version, "1.7.0") diff --git a/Tests/ModelTests/CommunicationRequestTests.swift b/Tests/ModelTests/CommunicationRequestTests.swift index a90e9a0b..c3cd6aab 100644 --- a/Tests/ModelTests/CommunicationRequestTests.swift +++ b/Tests/ModelTests/CommunicationRequestTests.swift @@ -2,7 +2,7 @@ // CommunicationRequestTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -45,9 +45,9 @@ class CommunicationRequestTests: XCTestCase { XCTAssertEqual(inst.recipient?[0].reference, "#provider") XCTAssertEqual(inst.requestedOn?.description, "2016-06-10T11:01:10-08:00") XCTAssertEqual(inst.sender?.reference, "#payor") - XCTAssertEqual(inst.status, "requested") + XCTAssertEqual(inst.status, CommunicationRequestStatus(rawValue: "requested")!) XCTAssertEqual(inst.text?.div, "
Request for Accident Report
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -69,7 +69,7 @@ class CommunicationRequestTests: XCTestCase { XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.text?.div, "
To be filled out at a later time
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/CommunicationTests.swift b/Tests/ModelTests/CommunicationTests.swift index b628bb85..5ccee65d 100644 --- a/Tests/ModelTests/CommunicationTests.swift +++ b/Tests/ModelTests/CommunicationTests.swift @@ -2,7 +2,7 @@ // CommunicationTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -53,10 +53,10 @@ class CommunicationTests: XCTestCase { XCTAssertEqual(inst.sender?.identifier?.system?.absoluteString, "http://www.jurisdiction.com/provideroffices") XCTAssertEqual(inst.sender?.identifier?.value, "3456") XCTAssertEqual(inst.sent?.description, "2016-06-12T18:01:10-08:00") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, CommunicationStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.reference, "Patient/1") XCTAssertEqual(inst.text?.div, "
Attachment which is unsolicited
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.topic?[0].identifier?.system?.absoluteString, "http://happyvalley.com/claim") XCTAssertEqual(inst.topic?[0].identifier?.value, "12345") XCTAssertEqual(inst.topic?[1].identifier?.system?.absoluteString, "http://www.BenefitsInc.com/fhir/claimresponse") @@ -100,10 +100,10 @@ class CommunicationTests: XCTestCase { XCTAssertEqual(inst.recipient?[0].reference, "#payor") XCTAssertEqual(inst.sender?.reference, "#provider") XCTAssertEqual(inst.sent?.description, "2016-06-12T18:01:10-08:00") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, CommunicationStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.reference, "Patient/1") XCTAssertEqual(inst.text?.div, "
Attachment in response to a Request
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -134,10 +134,10 @@ class CommunicationTests: XCTestCase { XCTAssertEqual(inst.recipient?[0].reference, "Practitioner/21") XCTAssertEqual(inst.sender?.reference, "Device/f001") XCTAssertEqual(inst.sent?.description, "2014-12-12T18:01:10-08:00") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, CommunicationStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.reference, "Patient/1") XCTAssertEqual(inst.text?.div, "
Patient has very high serum potassium
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/CompositionTests.swift b/Tests/ModelTests/CompositionTests.swift index 400806d1..6237dce3 100644 --- a/Tests/ModelTests/CompositionTests.swift +++ b/Tests/ModelTests/CompositionTests.swift @@ -2,7 +2,7 @@ // CompositionTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -34,15 +34,15 @@ class CompositionTests: XCTestCase { func runComposition1(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Composition { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "composition-example.json") - XCTAssertEqual(inst.attester?[0].mode?[0], "legal") + XCTAssertEqual(inst.`class`?.coding?[0].code, "LP173421-1") + XCTAssertEqual(inst.`class`?.coding?[0].display, "Report") + XCTAssertEqual(inst.`class`?.coding?[0].system?.absoluteString, "http://loinc.org") + XCTAssertEqual(inst.attester?[0].mode?[0], CompositionAttestationMode(rawValue: "legal")!) XCTAssertEqual(inst.attester?[0].party?.display, "Harold Hippocrates, MD") XCTAssertEqual(inst.attester?[0].party?.reference, "Practitioner/xcda-author") XCTAssertEqual(inst.attester?[0].time?.description, "2012-01-04T09:10:14Z") XCTAssertEqual(inst.author?[0].display, "Harold Hippocrates, MD") XCTAssertEqual(inst.author?[0].reference, "Practitioner/xcda-author") - XCTAssertEqual(inst.class_fhir?.coding?[0].code, "LP173421-1") - XCTAssertEqual(inst.class_fhir?.coding?[0].display, "Report") - XCTAssertEqual(inst.class_fhir?.coding?[0].system?.absoluteString, "http://loinc.org") XCTAssertEqual(inst.confidentiality, "N") XCTAssertEqual(inst.custodian?.display, "Good Health Clinic") XCTAssertEqual(inst.custodian?.reference, "Organization/2.16.840.1.113883.19.5") @@ -63,11 +63,11 @@ class CompositionTests: XCTestCase { XCTAssertEqual(inst.section?[0].entry?[0].reference, "Condition/stroke") XCTAssertEqual(inst.section?[0].entry?[1].reference, "Condition/example") XCTAssertEqual(inst.section?[0].entry?[2].reference, "Condition/example2") - XCTAssertEqual(inst.section?[0].mode, "snapshot") + XCTAssertEqual(inst.section?[0].mode, ListMode(rawValue: "snapshot")!) XCTAssertEqual(inst.section?[0].orderedBy?.coding?[0].code, "event-date") XCTAssertEqual(inst.section?[0].orderedBy?.coding?[0].display, "Sorted by Event Date") XCTAssertEqual(inst.section?[0].orderedBy?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/list-order") - XCTAssertEqual(inst.section?[0].text?.status, "generated") + XCTAssertEqual(inst.section?[0].text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.section?[0].title, "History of present illness") XCTAssertEqual(inst.section?[1].code?.coding?[0].code, "10157-6") XCTAssertEqual(inst.section?[1].code?.coding?[0].display, "History of family member diseases Narrative") @@ -75,13 +75,13 @@ class CompositionTests: XCTestCase { XCTAssertEqual(inst.section?[1].emptyReason?.coding?[0].code, "withheld") XCTAssertEqual(inst.section?[1].emptyReason?.coding?[0].display, "Information Withheld") XCTAssertEqual(inst.section?[1].emptyReason?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/list-empty-reason") - XCTAssertEqual(inst.section?[1].mode, "snapshot") - XCTAssertEqual(inst.section?[1].text?.status, "generated") + XCTAssertEqual(inst.section?[1].mode, ListMode(rawValue: "snapshot")!) + XCTAssertEqual(inst.section?[1].text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.section?[1].title, "History of family member diseases") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, CompositionStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.display, "Henry Levin the 7th") XCTAssertEqual(inst.subject?.reference, "Patient/xcda") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.title, "Consultation Note") XCTAssertEqual(inst.type?.coding?[0].code, "11488-4") XCTAssertEqual(inst.type?.coding?[0].display, "Consult note") diff --git a/Tests/ModelTests/ConceptMapTests.swift b/Tests/ModelTests/ConceptMapTests.swift index 45b1d520..7e34c874 100644 --- a/Tests/ModelTests/ConceptMapTests.swift +++ b/Tests/ModelTests/ConceptMapTests.swift @@ -2,7 +2,7 @@ // ConceptMapTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -34,9 +34,9 @@ class ConceptMapTests: XCTestCase { func runConceptMap1(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.ConceptMap { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "conceptmap-example-specimen-type.json") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "http://hl7.org/fhir") - XCTAssertEqual(inst.contact?[1].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[1].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[1].telecom?[0].value, "http://www.phconnect.org/group/laboratorymessagingcommunityofpractice/forum/attachment/download?id=3649725%3AUploadedFile%3A145786") XCTAssertEqual(inst.date?.description, "2013-07-25") XCTAssertFalse(inst.experimental ?? true) @@ -68,7 +68,7 @@ class ConceptMapTests: XCTestCase { XCTAssertEqual(inst.group?[0].element?[6].target?[0].comments, "TBD in detail") XCTAssertEqual(inst.group?[0].element?[7].code, "ASERU") XCTAssertEqual(inst.group?[0].element?[7].target?[0].comments, "pending") - XCTAssertEqual(inst.group?[0].element?[7].target?[0].equivalence, "unmatched") + XCTAssertEqual(inst.group?[0].element?[7].target?[0].equivalence, ConceptMapEquivalence(rawValue: "unmatched")!) XCTAssertEqual(inst.group?[0].element?[8].code, "ASP") XCTAssertEqual(inst.group?[0].element?[8].target?[0].code, "119295008") XCTAssertEqual(inst.group?[0].element?[8].target?[0].product?[0].code, "14766002") @@ -76,16 +76,16 @@ class ConceptMapTests: XCTestCase { XCTAssertEqual(inst.group?[0].element?[8].target?[0].product?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.group?[0].element?[9].code, "ATTE") XCTAssertEqual(inst.group?[0].element?[9].target?[0].comments, "TBD") - XCTAssertEqual(inst.group?[0].element?[9].target?[0].equivalence, "unmatched") + XCTAssertEqual(inst.group?[0].element?[9].target?[0].equivalence, ConceptMapEquivalence(rawValue: "unmatched")!) XCTAssertEqual(inst.group?[0].source?.absoluteString, "http://hl7.org/fhir/v2/0487") XCTAssertEqual(inst.group?[0].target?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.id, "102") XCTAssertEqual(inst.name, "Specimen mapping from v2 table 0487 to SNOMED CT") XCTAssertEqual(inst.publisher, "FHIR project team (original source: LabMCoP)") XCTAssertEqual(inst.sourceReference?.reference, "http://hl7.org/fhir/ValueSet/v2-0487") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) XCTAssertEqual(inst.targetReference?.reference, "http://snomed.info/id?fhir_vs") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/ConceptMap/102") XCTAssertEqual(inst.version, "20130725") @@ -107,7 +107,7 @@ class ConceptMapTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "conceptmap-example.json") XCTAssertEqual(inst.contact?[0].name, "FHIR project team (example)") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "http://hl7.org/fhir") XCTAssertEqual(inst.copyright, "Creative Commons 0") XCTAssertEqual(inst.date?.description, "2012-06-13") @@ -124,7 +124,7 @@ class ConceptMapTests: XCTestCase { XCTAssertEqual(inst.group?[0].element?[4].code, "old") XCTAssertEqual(inst.group?[0].element?[4].target?[0].code, "BAD") XCTAssertEqual(inst.group?[0].element?[4].target?[0].comments, "In the HL7 v3 AD, old is handled by the usablePeriod element, but you have to provide a time, there's no simple equivalent of flagging an address as old") - XCTAssertEqual(inst.group?[0].element?[4].target?[0].equivalence, "disjoint") + XCTAssertEqual(inst.group?[0].element?[4].target?[0].equivalence, ConceptMapEquivalence(rawValue: "disjoint")!) XCTAssertEqual(inst.group?[0].source?.absoluteString, "http://hl7.org/fhir/address-use") XCTAssertEqual(inst.group?[0].target?.absoluteString, "http://hl7.org/fhir/v3/AddressUse") XCTAssertEqual(inst.id, "101") @@ -134,9 +134,9 @@ class ConceptMapTests: XCTestCase { XCTAssertEqual(inst.publisher, "HL7, Inc") XCTAssertEqual(inst.purpose, "To help implementers map from HL7 v3/CDA to FHIR") XCTAssertEqual(inst.sourceReference?.reference, "http://hl7.org/fhir/ValueSet/address-use") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) XCTAssertEqual(inst.targetReference?.reference, "http://hl7.org/fhir/ValueSet/v3-AddressUse") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/ConceptMap/101") XCTAssertEqual(inst.useContext?[0].code?.code, "venue") XCTAssertEqual(inst.useContext?[0].code?.system?.absoluteString, "http://hl7.org/fhir/usage-context-type") diff --git a/Tests/ModelTests/ConditionTests.swift b/Tests/ModelTests/ConditionTests.swift index 3e27fc63..a6683bf0 100644 --- a/Tests/ModelTests/ConditionTests.swift +++ b/Tests/ModelTests/ConditionTests.swift @@ -2,7 +2,7 @@ // ConditionTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -59,8 +59,8 @@ class ConditionTests: XCTestCase { XCTAssertEqual(inst.severity?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.subject?.display, "P. van de Heuvel") XCTAssertEqual(inst.subject?.reference, "Patient/f001") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.verificationStatus, "confirmed") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.verificationStatus, ConditionVerificationStatus(rawValue: "confirmed")!) return inst } @@ -106,8 +106,8 @@ class ConditionTests: XCTestCase { XCTAssertEqual(inst.stage?.summary?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.subject?.display, "P. van de Heuvel") XCTAssertEqual(inst.subject?.reference, "Patient/f001") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.verificationStatus, "confirmed") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.verificationStatus, ConditionVerificationStatus(rawValue: "confirmed")!) return inst } @@ -150,8 +150,8 @@ class ConditionTests: XCTestCase { XCTAssertEqual(inst.severity?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.subject?.display, "P. van de Heuvel") XCTAssertEqual(inst.subject?.reference, "Patient/f001") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.verificationStatus, "confirmed") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.verificationStatus, ConditionVerificationStatus(rawValue: "confirmed")!) return inst } @@ -197,8 +197,8 @@ class ConditionTests: XCTestCase { XCTAssertEqual(inst.severity?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.subject?.display, "Roel") XCTAssertEqual(inst.subject?.reference, "Patient/f201") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.verificationStatus, "confirmed") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.verificationStatus, ConditionVerificationStatus(rawValue: "confirmed")!) return inst } @@ -239,8 +239,8 @@ class ConditionTests: XCTestCase { XCTAssertEqual(inst.severity?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.subject?.display, "Roel") XCTAssertEqual(inst.subject?.reference, "Patient/f201") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.verificationStatus, "confirmed") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.verificationStatus, ConditionVerificationStatus(rawValue: "confirmed")!) return inst } @@ -284,8 +284,8 @@ class ConditionTests: XCTestCase { XCTAssertEqual(inst.severity?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.subject?.display, "Roel") XCTAssertEqual(inst.subject?.reference, "Patient/f201") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.verificationStatus, "confirmed") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.verificationStatus, ConditionVerificationStatus(rawValue: "confirmed")!) return inst } @@ -331,8 +331,8 @@ class ConditionTests: XCTestCase { XCTAssertEqual(inst.stage?.summary?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.subject?.display, "Roel") XCTAssertEqual(inst.subject?.reference, "Patient/f201") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.verificationStatus, "differential") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.verificationStatus, ConditionVerificationStatus(rawValue: "differential")!) return inst } @@ -360,8 +360,8 @@ class ConditionTests: XCTestCase { XCTAssertEqual(inst.id, "f205") XCTAssertEqual(inst.subject?.display, "Roel") XCTAssertEqual(inst.subject?.reference, "Patient/f201") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.verificationStatus, "differential") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.verificationStatus, ConditionVerificationStatus(rawValue: "differential")!) return inst } @@ -392,8 +392,8 @@ class ConditionTests: XCTestCase { XCTAssertEqual(inst.onsetDateTime?.description, "2010-07-18") XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.text?.div, "
Ischemic stroke, July 18, 2010
") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.verificationStatus, "confirmed") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.verificationStatus, ConditionVerificationStatus(rawValue: "confirmed")!) return inst } @@ -433,8 +433,8 @@ class ConditionTests: XCTestCase { XCTAssertEqual(inst.severity?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.text?.div, "
Severe burn of left ear (Date: 24-May 2012)
") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.verificationStatus, "confirmed") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.verificationStatus, ConditionVerificationStatus(rawValue: "confirmed")!) return inst } diff --git a/Tests/ModelTests/ConsentTests.swift b/Tests/ModelTests/ConsentTests.swift index 6b8ac2b9..5f537efc 100644 --- a/Tests/ModelTests/ConsentTests.swift +++ b/Tests/ModelTests/ConsentTests.swift @@ -2,7 +2,7 @@ // ConsentTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -41,12 +41,12 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[0].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") XCTAssertEqual(inst.except?[0].purpose?[0].code, "ETREAT") XCTAssertEqual(inst.except?[0].purpose?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ActReason") - XCTAssertEqual(inst.except?[0].type, "permit") + XCTAssertEqual(inst.except?[0].type, ConsentExceptType(rawValue: "permit")!) XCTAssertEqual(inst.except?[1].actor?[0].reference?.display, "Good Health Psychiatric Hospital") XCTAssertEqual(inst.except?[1].actor?[0].reference?.reference, "Organization/2.16.840.1.113883.19.6") XCTAssertEqual(inst.except?[1].actor?[0].role?.coding?[0].code, "CST") XCTAssertEqual(inst.except?[1].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") - XCTAssertEqual(inst.except?[1].type, "deny") + XCTAssertEqual(inst.except?[1].type, ConsentExceptType(rawValue: "deny")!) XCTAssertEqual(inst.id, "consent-example-Emergency") XCTAssertEqual(inst.organization?.display, "Canada Infoway") XCTAssertEqual(inst.organization?.reference, "Organization/Infoway") @@ -54,8 +54,8 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/f001") XCTAssertEqual(inst.policy?.absoluteString, "http://hl7.org/fhir/ConsentPolicy/opt-in") XCTAssertEqual(inst.sourceAttachment?.title, "The terms of the consent in lawyer speak.") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, ConsentStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -85,7 +85,7 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[0].actor?[1].reference?.reference, "Patient/example") XCTAssertEqual(inst.except?[0].actor?[1].role?.coding?[0].code, "PRCP") XCTAssertEqual(inst.except?[0].actor?[1].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") - XCTAssertEqual(inst.except?[0].type, "permit") + XCTAssertEqual(inst.except?[0].type, ConsentExceptType(rawValue: "permit")!) XCTAssertEqual(inst.id, "consent-example-grantor") XCTAssertEqual(inst.organization?.display, "Canada Infoway") XCTAssertEqual(inst.organization?.reference, "Organization/Infoway") @@ -93,8 +93,8 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/f001") XCTAssertEqual(inst.policy?.absoluteString, "http://hl7.org/fhir/ConsentPolicy/opt-in") XCTAssertEqual(inst.sourceAttachment?.title, "The terms of the consent in lawyer speak.") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, ConsentStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -118,7 +118,7 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[0].actor?[0].reference?.reference, "Organization/2.16.840.1.113883.19.5") XCTAssertEqual(inst.except?[0].actor?[0].role?.coding?[0].code, "CST") XCTAssertEqual(inst.except?[0].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") - XCTAssertEqual(inst.except?[0].type, "deny") + XCTAssertEqual(inst.except?[0].type, ConsentExceptType(rawValue: "deny")!) XCTAssertEqual(inst.id, "consent-example-notAuthor") XCTAssertEqual(inst.organization?.display, "Canada Infoway") XCTAssertEqual(inst.organization?.reference, "Organization/Infoway") @@ -126,8 +126,8 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/f001") XCTAssertEqual(inst.policy?.absoluteString, "http://hl7.org/fhir/ConsentPolicy/opt-out") XCTAssertEqual(inst.sourceAttachment?.title, "The terms of the consent in lawyer speak.") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, ConsentStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -155,7 +155,7 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[0].actor?[0].reference?.reference, "Organization/2.16.840.1.113883.19.5") XCTAssertEqual(inst.except?[0].actor?[0].role?.coding?[0].code, "PRCP") XCTAssertEqual(inst.except?[0].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") - XCTAssertEqual(inst.except?[0].type, "deny") + XCTAssertEqual(inst.except?[0].type, ConsentExceptType(rawValue: "deny")!) XCTAssertEqual(inst.id, "consent-example-notOrg") XCTAssertEqual(inst.organization?.display, "Canada Infoway") XCTAssertEqual(inst.organization?.reference, "Organization/Infoway") @@ -163,8 +163,8 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/f001") XCTAssertEqual(inst.policy?.absoluteString, "http://hl7.org/fhir/ConsentPolicy/opt-out") XCTAssertEqual(inst.sourceAttachment?.title, "The terms of the consent in lawyer speak.") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, ConsentStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -192,7 +192,7 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[0].actor?[0].reference?.reference, "Practitioner/f204") XCTAssertEqual(inst.except?[0].actor?[0].role?.coding?[0].code, "PRCP") XCTAssertEqual(inst.except?[0].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") - XCTAssertEqual(inst.except?[0].type, "deny") + XCTAssertEqual(inst.except?[0].type, ConsentExceptType(rawValue: "deny")!) XCTAssertEqual(inst.id, "consent-example-notThem") XCTAssertEqual(inst.organization?.display, "Canada Infoway") XCTAssertEqual(inst.organization?.reference, "Organization/Infoway") @@ -200,8 +200,8 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/f001") XCTAssertEqual(inst.policy?.absoluteString, "http://hl7.org/fhir/ConsentPolicy/opt-out") XCTAssertEqual(inst.sourceAttachment?.title, "The terms of the consent in lawyer speak.") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, ConsentStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -221,9 +221,9 @@ class ConsentTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "consent-example-notThis.json") XCTAssertEqual(inst.dateTime?.description, "2015-11-18") - XCTAssertEqual(inst.except?[0].data?[0].meaning, "related") + XCTAssertEqual(inst.except?[0].data?[0].meaning, ConsentDataMeaning(rawValue: "related")!) XCTAssertEqual(inst.except?[0].data?[0].reference?.reference, "Task/f201") - XCTAssertEqual(inst.except?[0].type, "deny") + XCTAssertEqual(inst.except?[0].type, ConsentExceptType(rawValue: "deny")!) XCTAssertEqual(inst.id, "consent-example-notThis") XCTAssertEqual(inst.organization?.display, "Canada Infoway") XCTAssertEqual(inst.organization?.reference, "Organization/Infoway") @@ -231,8 +231,8 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/f001") XCTAssertEqual(inst.policy?.absoluteString, "http://hl7.org/fhir/ConsentPolicy/opt-out") XCTAssertEqual(inst.sourceAttachment?.title, "The terms of the consent in lawyer speak.") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, ConsentStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -254,7 +254,7 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.dateTime?.description, "2015-11-18") XCTAssertEqual(inst.except?[0].period?.end?.description, "2015-02-01") XCTAssertEqual(inst.except?[0].period?.start?.description, "2015-01-01") - XCTAssertEqual(inst.except?[0].type, "deny") + XCTAssertEqual(inst.except?[0].type, ConsentExceptType(rawValue: "deny")!) XCTAssertEqual(inst.id, "consent-example-notTime") XCTAssertEqual(inst.organization?.display, "Canada Infoway") XCTAssertEqual(inst.organization?.reference, "Organization/Infoway") @@ -262,8 +262,8 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/f001") XCTAssertEqual(inst.policy?.absoluteString, "http://hl7.org/fhir/ConsentPolicy/opt-out") XCTAssertEqual(inst.sourceAttachment?.title, "The terms of the consent in lawyer speak.") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, ConsentStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -287,7 +287,7 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[0].actor?[0].reference?.reference, "Organization/2.16.840.1.113883.19.6") XCTAssertEqual(inst.except?[0].actor?[0].role?.coding?[0].code, "CST") XCTAssertEqual(inst.except?[0].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") - XCTAssertEqual(inst.except?[0].type, "deny") + XCTAssertEqual(inst.except?[0].type, ConsentExceptType(rawValue: "deny")!) XCTAssertEqual(inst.id, "consent-example-Out") XCTAssertEqual(inst.organization?.display, "Canada Infoway") XCTAssertEqual(inst.organization?.reference, "Organization/Infoway") @@ -295,8 +295,8 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/f001") XCTAssertEqual(inst.policy?.absoluteString, "http://hl7.org/fhir/ConsentPolicy/opt-out") XCTAssertEqual(inst.sourceAttachment?.title, "The terms of the consent in lawyer speak.") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, ConsentStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -324,7 +324,7 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[0].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") XCTAssertEqual(inst.except?[0].securityLabel?[0].code, "N") XCTAssertEqual(inst.except?[0].securityLabel?[0].system?.absoluteString, "http://hl7.org/fhir/v3/Confidentiality") - XCTAssertEqual(inst.except?[0].type, "permit") + XCTAssertEqual(inst.except?[0].type, ConsentExceptType(rawValue: "permit")!) XCTAssertEqual(inst.except?[1].action?[0].coding?[0].code, "access") XCTAssertEqual(inst.except?[1].action?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/consentaction") XCTAssertEqual(inst.except?[1].actor?[0].reference?.display, "Non-migrated Team - Imperial College Healthcare") @@ -333,7 +333,7 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[1].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") XCTAssertEqual(inst.except?[1].securityLabel?[0].code, "PSY") XCTAssertEqual(inst.except?[1].securityLabel?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") - XCTAssertEqual(inst.except?[1].type, "permit") + XCTAssertEqual(inst.except?[1].type, ConsentExceptType(rawValue: "permit")!) XCTAssertEqual(inst.except?[2].action?[0].coding?[0].code, "access") XCTAssertEqual(inst.except?[2].action?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/consentaction") XCTAssertEqual(inst.except?[2].actor?[0].reference?.display, "Non-migrated Team - Imperial College Healthcare") @@ -342,7 +342,7 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[2].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") XCTAssertEqual(inst.except?[2].securityLabel?[0].code, "SOC") XCTAssertEqual(inst.except?[2].securityLabel?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") - XCTAssertEqual(inst.except?[2].type, "permit") + XCTAssertEqual(inst.except?[2].type, ConsentExceptType(rawValue: "permit")!) XCTAssertEqual(inst.except?[3].action?[0].coding?[0].code, "access") XCTAssertEqual(inst.except?[3].action?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/consentaction") XCTAssertEqual(inst.except?[3].actor?[0].reference?.display, "Core Information Exchange team - Imperial College Healthcare") @@ -351,7 +351,7 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[3].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") XCTAssertEqual(inst.except?[3].securityLabel?[0].code, "N") XCTAssertEqual(inst.except?[3].securityLabel?[0].system?.absoluteString, "http://hl7.org/fhir/v3/Confidentiality") - XCTAssertEqual(inst.except?[3].type, "permit") + XCTAssertEqual(inst.except?[3].type, ConsentExceptType(rawValue: "permit")!) XCTAssertEqual(inst.except?[4].action?[0].coding?[0].code, "access") XCTAssertEqual(inst.except?[4].action?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/consentaction") XCTAssertEqual(inst.except?[4].actor?[0].reference?.display, "Core Information Exchange team - Imperial College Healthcare") @@ -360,7 +360,7 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[4].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") XCTAssertEqual(inst.except?[4].securityLabel?[0].code, "PSY") XCTAssertEqual(inst.except?[4].securityLabel?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") - XCTAssertEqual(inst.except?[4].type, "permit") + XCTAssertEqual(inst.except?[4].type, ConsentExceptType(rawValue: "permit")!) XCTAssertEqual(inst.except?[5].action?[0].coding?[0].code, "access") XCTAssertEqual(inst.except?[5].action?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/consentaction") XCTAssertEqual(inst.except?[5].actor?[0].reference?.display, "Core Information Exchange team - Imperial College Healthcare") @@ -369,7 +369,7 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[5].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") XCTAssertEqual(inst.except?[5].securityLabel?[0].code, "SOC") XCTAssertEqual(inst.except?[5].securityLabel?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") - XCTAssertEqual(inst.except?[5].type, "permit") + XCTAssertEqual(inst.except?[5].type, ConsentExceptType(rawValue: "permit")!) XCTAssertEqual(inst.except?[6].action?[0].coding?[0].code, "access") XCTAssertEqual(inst.except?[6].action?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/consentaction") XCTAssertEqual(inst.except?[6].actor?[0].reference?.display, "Core Information Exchange team - Imperial College Healthcare") @@ -378,7 +378,7 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[6].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") XCTAssertEqual(inst.except?[6].securityLabel?[0].code, "SEX") XCTAssertEqual(inst.except?[6].securityLabel?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") - XCTAssertEqual(inst.except?[6].type, "permit") + XCTAssertEqual(inst.except?[6].type, ConsentExceptType(rawValue: "permit")!) XCTAssertEqual(inst.except?[7].action?[0].coding?[0].code, "access") XCTAssertEqual(inst.except?[7].action?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/consentaction") XCTAssertEqual(inst.except?[7].actor?[0].reference?.display, "Torbay and Source Devon Trust - Parkinson's Team") @@ -387,7 +387,7 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[7].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") XCTAssertEqual(inst.except?[7].securityLabel?[0].code, "N") XCTAssertEqual(inst.except?[7].securityLabel?[0].system?.absoluteString, "http://hl7.org/fhir/v3/Confidentiality") - XCTAssertEqual(inst.except?[7].type, "permit") + XCTAssertEqual(inst.except?[7].type, ConsentExceptType(rawValue: "permit")!) XCTAssertEqual(inst.except?[8].action?[0].coding?[0].code, "access") XCTAssertEqual(inst.except?[8].action?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/consentaction") XCTAssertEqual(inst.except?[8].actor?[0].reference?.display, "Torbay and Source Devon Trust - Parkinson's Team") @@ -396,7 +396,7 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[8].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") XCTAssertEqual(inst.except?[8].securityLabel?[0].code, "PSY") XCTAssertEqual(inst.except?[8].securityLabel?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") - XCTAssertEqual(inst.except?[8].type, "permit") + XCTAssertEqual(inst.except?[8].type, ConsentExceptType(rawValue: "permit")!) XCTAssertEqual(inst.except?[9].action?[0].coding?[0].code, "access") XCTAssertEqual(inst.except?[9].action?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/consentaction") XCTAssertEqual(inst.except?[9].actor?[0].reference?.display, "Torbay and Source Devon Trust - Parkinson's Team") @@ -405,15 +405,15 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.except?[9].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") XCTAssertEqual(inst.except?[9].securityLabel?[0].code, "SOC") XCTAssertEqual(inst.except?[9].securityLabel?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") - XCTAssertEqual(inst.except?[9].type, "permit") + XCTAssertEqual(inst.except?[9].type, ConsentExceptType(rawValue: "permit")!) XCTAssertEqual(inst.id, "consent-example-pkb") XCTAssertEqual(inst.organization?.display, "Patients Know Best") XCTAssertEqual(inst.organization?.reference, "Organization/pkb") XCTAssertEqual(inst.patient?.display, "...example patient...") XCTAssertEqual(inst.patient?.reference, "Patient/example") XCTAssertEqual(inst.policy?.absoluteString, "http://hl7.org/fhir/ConsentPolicy/opt-in") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, ConsentStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -434,16 +434,16 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.consentor?[0].reference, "Patient/72") XCTAssertEqual(inst.dateTime?.description, "2016-05-26T00:41:10-04:00") + XCTAssertEqual(inst.except?[0].`class`?[0].code, "application/hl7-cda+xml") + XCTAssertEqual(inst.except?[0].`class`?[0].system?.absoluteString, "urn:ietf:bcp:13") XCTAssertEqual(inst.except?[0].actor?[0].reference?.reference, "Practitioner/xcda-author") XCTAssertEqual(inst.except?[0].actor?[0].role?.coding?[0].code, "AUT") XCTAssertEqual(inst.except?[0].actor?[0].role?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") - XCTAssertEqual(inst.except?[0].class_fhir?[0].code, "application/hl7-cda+xml") - XCTAssertEqual(inst.except?[0].class_fhir?[0].system?.absoluteString, "urn:ietf:bcp:13") XCTAssertEqual(inst.except?[0].code?[0].code, "34133-9") XCTAssertEqual(inst.except?[0].code?[0].system?.absoluteString, "http://loinc.org") XCTAssertEqual(inst.except?[0].code?[1].code, "18842-5") XCTAssertEqual(inst.except?[0].code?[1].system?.absoluteString, "http://loinc.org") - XCTAssertEqual(inst.except?[0].type, "permit") + XCTAssertEqual(inst.except?[0].type, ConsentExceptType(rawValue: "permit")!) XCTAssertEqual(inst.id, "consent-example-signature") XCTAssertEqual(inst.identifier?.system?.absoluteString, "urn:oid:2.16.840.1.113883.3.72.5.9.1") XCTAssertEqual(inst.identifier?.value, "494e0c7a-a69e-4fb4-9d02-6aae747790d7") @@ -453,8 +453,8 @@ class ConsentTests: XCTestCase { XCTAssertEqual(inst.period?.start?.description, "2015-10-10") XCTAssertEqual(inst.policy?.absoluteString, "http://hl7.org/fhir/ConsentPolicy/opt-in") XCTAssertEqual(inst.recipient?[0].reference, "Practitioner/13") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, ConsentStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/ContractTests.swift b/Tests/ModelTests/ContractTests.swift index fbfcbf6e..7a5c734a 100644 --- a/Tests/ModelTests/ContractTests.swift +++ b/Tests/ModelTests/ContractTests.swift @@ -2,7 +2,7 @@ // ContractTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -36,7 +36,7 @@ class ContractTests: XCTestCase { XCTAssertEqual(inst.id, "C-123") XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the contract
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/CoverageTests.swift b/Tests/ModelTests/CoverageTests.swift index afab6743..976e23c7 100644 --- a/Tests/ModelTests/CoverageTests.swift +++ b/Tests/ModelTests/CoverageTests.swift @@ -2,7 +2,7 @@ // CoverageTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -53,9 +53,9 @@ class CoverageTests: XCTestCase { XCTAssertEqual(inst.period?.start?.description, "2011-03-17") XCTAssertEqual(inst.planholder?.reference, "Patient/5") XCTAssertEqual(inst.relationship?.code, "self") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, CoverageStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the coverage
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "EHCPOL") XCTAssertEqual(inst.type?.display, "extended healthcare") XCTAssertEqual(inst.type?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") @@ -86,9 +86,9 @@ class CoverageTests: XCTestCase { XCTAssertEqual(inst.period?.end?.description, "2012-03-17") XCTAssertEqual(inst.planholder?.reference, "Patient/5") XCTAssertEqual(inst.relationship?.code, "self") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, CoverageStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the European Health Insurance Card
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "EHCPOL") XCTAssertEqual(inst.type?.display, "extended healthcare") XCTAssertEqual(inst.type?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") @@ -127,9 +127,9 @@ class CoverageTests: XCTestCase { XCTAssertEqual(inst.planholder?.reference, "Patient/4") XCTAssertEqual(inst.relationship?.code, "self") XCTAssertEqual(inst.sequence, UInt(1)) - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, CoverageStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the coverage
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.code, "EHCPOL") XCTAssertEqual(inst.type?.display, "extended healthcare") XCTAssertEqual(inst.type?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") diff --git a/Tests/ModelTests/DataElementTests.swift b/Tests/ModelTests/DataElementTests.swift index 77d0028f..0c278cb6 100644 --- a/Tests/ModelTests/DataElementTests.swift +++ b/Tests/ModelTests/DataElementTests.swift @@ -2,7 +2,7 @@ // DataElementTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -37,7 +37,7 @@ class DataElementTests: XCTestCase { XCTAssertEqual(inst.contained?[0].id, "2179414") XCTAssertEqual(inst.contained?[1].id, "2179414-permitted") XCTAssertEqual(inst.contained?[2].id, "2179414-cm") - XCTAssertEqual(inst.element?[0].binding?.strength, "required") + XCTAssertEqual(inst.element?[0].binding?.strength, BindingStrength(rawValue: "required")!) XCTAssertEqual(inst.element?[0].binding?.valueSetReference?.extension_fhir?[0].url?.absoluteString, "http://hl7.org/fhir/StructureDefinition/11179-permitted-value-valueset") XCTAssertEqual(inst.element?[0].binding?.valueSetReference?.extension_fhir?[0].valueReference?.reference, "#2179414-permitted") XCTAssertEqual(inst.element?[0].binding?.valueSetReference?.extension_fhir?[1].url?.absoluteString, "http://hl7.org/fhir/StructureDefinition/11179-permitted-value-conceptmap") @@ -55,8 +55,8 @@ class DataElementTests: XCTestCase { XCTAssertEqual(inst.identifier?[0].value, "2179650") XCTAssertEqual(inst.name, "Gender Code") XCTAssertEqual(inst.publisher, "DCP") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.version, "1.0") return inst @@ -103,8 +103,8 @@ class DataElementTests: XCTestCase { XCTAssertEqual(inst.mapping?[0].name, "LOINC") XCTAssertEqual(inst.mapping?[0].uri?.absoluteString, "http://loinc.org/") XCTAssertEqual(inst.name, "Prothrombin Time") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/DetectedIssueTests.swift b/Tests/ModelTests/DetectedIssueTests.swift index 54aa1d9d..d9d9283c 100644 --- a/Tests/ModelTests/DetectedIssueTests.swift +++ b/Tests/ModelTests/DetectedIssueTests.swift @@ -2,7 +2,7 @@ // DetectedIssueTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -36,7 +36,7 @@ class DetectedIssueTests: XCTestCase { XCTAssertEqual(inst.id, "allergy") XCTAssertEqual(inst.text?.div, "
[Put rendering here]
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -66,7 +66,7 @@ class DetectedIssueTests: XCTestCase { XCTAssertEqual(inst.implicated?[0].reference, "DiagnosticRequest/di") XCTAssertEqual(inst.implicated?[1].display, "Image 1 from Series 3: CT Images on Patient MINT (MINT1234) taken at 1-Jan 2011 01:20 AM") XCTAssertEqual(inst.implicated?[1].reference, "ImagingStudy/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -87,7 +87,7 @@ class DetectedIssueTests: XCTestCase { XCTAssertEqual(inst.id, "lab") XCTAssertEqual(inst.text?.div, "
[Put rendering here]
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -123,8 +123,8 @@ class DetectedIssueTests: XCTestCase { XCTAssertEqual(inst.mitigation?[0].author?.display, "Dr. Adam Careful") XCTAssertEqual(inst.mitigation?[0].author?.reference, "Practitioner/example") XCTAssertEqual(inst.mitigation?[0].date?.description, "2014-01-05") - XCTAssertEqual(inst.severity, "high") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.severity, DetectedIssueSeverity(rawValue: "high")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/DeviceComponentTests.swift b/Tests/ModelTests/DeviceComponentTests.swift index 59452381..56dd52eb 100644 --- a/Tests/ModelTests/DeviceComponentTests.swift +++ b/Tests/ModelTests/DeviceComponentTests.swift @@ -2,7 +2,7 @@ // DeviceComponentTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -57,7 +57,7 @@ class DeviceComponentTests: XCTestCase { XCTAssertEqual(inst.productionSpecification?[3].specType?.coding?[0].code, "5") XCTAssertEqual(inst.productionSpecification?[3].specType?.coding?[0].display, "Firmware version") XCTAssertEqual(inst.source?.reference, "#d1") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "2000") XCTAssertEqual(inst.type?.coding?[0].display, "MDC_DEV_ANALY_SAT_O2_MDS") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "urn:iso:std:iso:11073:10101") @@ -90,7 +90,7 @@ class DeviceComponentTests: XCTestCase { XCTAssertEqual(inst.operationalStatus?[0].coding?[0].display, "disconnected") XCTAssertEqual(inst.operationalStatus?[0].coding?[0].system?.absoluteString, "urn:iso:std:iso:11073:10101") XCTAssertEqual(inst.source?.reference, "#d1") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "2000") XCTAssertEqual(inst.type?.coding?[0].display, "MDC_DEV_ANALY_SAT_O2_MDS") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "urn:iso:std:iso:11073:10101") diff --git a/Tests/ModelTests/DeviceMetricTests.swift b/Tests/ModelTests/DeviceMetricTests.swift index f4c7c1ed..4d96f4c0 100644 --- a/Tests/ModelTests/DeviceMetricTests.swift +++ b/Tests/ModelTests/DeviceMetricTests.swift @@ -2,7 +2,7 @@ // DeviceMetricTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -34,11 +34,11 @@ class DeviceMetricTests: XCTestCase { func runDeviceMetric1(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.DeviceMetric { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "devicemetric-example.json") - XCTAssertEqual(inst.category, "measurement") + XCTAssertEqual(inst.category, DeviceMetricCategory(rawValue: "measurement")!) XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.identifier?.system?.absoluteString, "http://goodcare.org/devicemetric/id") XCTAssertEqual(inst.identifier?.value, "345675") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "150456") XCTAssertEqual(inst.type?.coding?[0].display, "MDC_PULS_OXIM_SAT_O2") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "https://rtmms.nist.gov") diff --git a/Tests/ModelTests/DeviceTests.swift b/Tests/ModelTests/DeviceTests.swift index 5849ab7c..aea8b652 100644 --- a/Tests/ModelTests/DeviceTests.swift +++ b/Tests/ModelTests/DeviceTests.swift @@ -2,7 +2,7 @@ // DeviceTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -41,8 +41,8 @@ class DeviceTests: XCTestCase { XCTAssertEqual(inst.location?.display, "Central Supply") XCTAssertEqual(inst.manufactureDate?.description, "2015-08-08") XCTAssertEqual(inst.owner?.reference, "Organization/2.16.840.1.113883.19.5") - XCTAssertEqual(inst.status, "available") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, DeviceStatus(rawValue: "available")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "25062003") XCTAssertEqual(inst.type?.coding?[0].display, "Feeding tube, device") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -74,7 +74,7 @@ class DeviceTests: XCTestCase { XCTAssertEqual(inst.lotNumber, "12345") XCTAssertEqual(inst.manufacturer, "Acme Devices, Inc") XCTAssertEqual(inst.model, "A.1.1") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.text, "Vital Signs Monitor") return inst @@ -94,7 +94,7 @@ class DeviceTests: XCTestCase { func runDevice3(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Device { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "device-example-pacemaker.json") - XCTAssertEqual(inst.contact?[0].system, "phone") + XCTAssertEqual(inst.contact?[0].system, ContactPointSystem(rawValue: "phone")!) XCTAssertEqual(inst.contact?[0].value, "ext 4352") XCTAssertEqual(inst.id, "example-pacemaker") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://acme.com/devices/pacemakers/octane/serial") @@ -103,7 +103,7 @@ class DeviceTests: XCTestCase { XCTAssertEqual(inst.manufacturer, "Acme Devices, Inc") XCTAssertEqual(inst.model, "PM/Octane 2014") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "octane2014") XCTAssertEqual(inst.type?.coding?[0].display, "Performance pace maker for high octane patients") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://acme.com/devices") @@ -125,13 +125,13 @@ class DeviceTests: XCTestCase { func runDevice4(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Device { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "device-example-software.json") - XCTAssertEqual(inst.contact?[0].system, "other") + XCTAssertEqual(inst.contact?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].value, "http://acme.com") XCTAssertEqual(inst.id, "software") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://acme.com/ehr/client-ids") XCTAssertEqual(inst.identifier?[0].value, "goodhealth") XCTAssertEqual(inst.manufacturer, "Acme Devices, Inc") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.text, "EHR") XCTAssertEqual(inst.url?.absoluteString, "http://acme.com/goodhealth/ehr/") XCTAssertEqual(inst.version, "10.23-23423") @@ -164,8 +164,8 @@ class DeviceTests: XCTestCase { XCTAssertEqual(inst.manufacturer, "Acme Devices, Inc") XCTAssertEqual(inst.model, "PM/Octane 2014") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.status, "not-available") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, DeviceStatus(rawValue: "not-available")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "09504000059118") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/NamingSystem/gs1-di") XCTAssertEqual(inst.type?.coding?[1].code, "468063009") @@ -203,8 +203,8 @@ class DeviceTests: XCTestCase { XCTAssertEqual(inst.manufacturer, "Acme Devices, Inc") XCTAssertEqual(inst.model, "Bone,Putty Demineralized") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.status, "not-available") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, DeviceStatus(rawValue: "not-available")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "A9999XYZ100T0474") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/NamingSystem/iccbba-other-di") XCTAssertEqual(inst.type?.text, "DI = A9999XYZ100T0474") @@ -240,8 +240,8 @@ class DeviceTests: XCTestCase { XCTAssertEqual(inst.manufacturer, "GlobalMed, Inc") XCTAssertEqual(inst.model, "Ultra Implantable") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.status, "not-available") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, DeviceStatus(rawValue: "not-available")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "H123PARTNO1234567890120") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/NamingSystem/hibcc-di") XCTAssertEqual(inst.type?.text, "DI =H123PARTNO1234567890120") @@ -271,8 +271,8 @@ class DeviceTests: XCTestCase { XCTAssertEqual(inst.lotNumber, "RZ12345678") XCTAssertEqual(inst.manufacturer, "GlobalMed, Inc") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.status, "not-available") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, DeviceStatus(rawValue: "not-available")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "1TE123456A") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/NamingSystem/iccbba-blood-di") XCTAssertEqual(inst.type?.text, "DI = 1TE123456A") @@ -298,7 +298,7 @@ class DeviceTests: XCTestCase { func runDevice9(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Device { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "device-example.json") - XCTAssertEqual(inst.contact?[0].system, "phone") + XCTAssertEqual(inst.contact?[0].system, ContactPointSystem(rawValue: "phone")!) XCTAssertEqual(inst.contact?[0].value, "ext 4352") XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://goodcare.org/devices/id") @@ -313,8 +313,8 @@ class DeviceTests: XCTestCase { XCTAssertEqual(inst.note?[0].authorReference?.reference, "Practitioner/xcda-author") XCTAssertEqual(inst.note?[0].text, "QA Checked") XCTAssertEqual(inst.note?[0].time?.description, "2015-06-28T14:03:32+10:00") - XCTAssertEqual(inst.status, "available") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, DeviceStatus(rawValue: "available")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "86184003") XCTAssertEqual(inst.type?.coding?[0].display, "Electrocardiographic monitor and recorder") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://snomed.info/sct") diff --git a/Tests/ModelTests/DeviceUseRequestTests.swift b/Tests/ModelTests/DeviceUseRequestTests.swift index 1391bdb8..5a018916 100644 --- a/Tests/ModelTests/DeviceUseRequestTests.swift +++ b/Tests/ModelTests/DeviceUseRequestTests.swift @@ -2,7 +2,7 @@ // DeviceUseRequestTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -40,7 +40,7 @@ class DeviceUseRequestTests: XCTestCase { XCTAssertEqual(inst.status, "completed") XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.text?.div, "
To be filled out at a later time
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/DeviceUseStatementTests.swift b/Tests/ModelTests/DeviceUseStatementTests.swift index db90d9ba..fda90351 100644 --- a/Tests/ModelTests/DeviceUseStatementTests.swift +++ b/Tests/ModelTests/DeviceUseStatementTests.swift @@ -2,7 +2,7 @@ // DeviceUseStatementTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -38,7 +38,7 @@ class DeviceUseStatementTests: XCTestCase { XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.text?.div, "
To be filled out at a later time
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/DiagnosticReportTests.swift b/Tests/ModelTests/DiagnosticReportTests.swift index 62a912d6..d45a09aa 100644 --- a/Tests/ModelTests/DiagnosticReportTests.swift +++ b/Tests/ModelTests/DiagnosticReportTests.swift @@ -2,7 +2,7 @@ // DiagnosticReportTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -46,9 +46,9 @@ class DiagnosticReportTests: XCTestCase { XCTAssertEqual(inst.performer?[0].display, "Acme Imaging Diagnostics") XCTAssertEqual(inst.performer?[0].reference, "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f") XCTAssertEqual(inst.result?[0].reference, "Observation/bmd") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, DiagnosticReportStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.reference, "Patient/pat2") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -80,7 +80,7 @@ class DiagnosticReportTests: XCTestCase { XCTAssertEqual(inst.effectiveDateTime?.description, "2013-04-02") XCTAssertEqual(inst.id, "f001") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://www.bmc.nl/zorgportal/identifiers/reports") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "nr1239044") XCTAssertEqual(inst.issued?.description, "2013-05-15T19:32:52+01:00") XCTAssertEqual(inst.performer?[0].display, "Burgers University Medical Centre") @@ -91,10 +91,10 @@ class DiagnosticReportTests: XCTestCase { XCTAssertEqual(inst.result?[2].reference, "Observation/f003") XCTAssertEqual(inst.result?[3].reference, "Observation/f004") XCTAssertEqual(inst.result?[4].reference, "Observation/f005") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, DiagnosticReportStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.display, "P. van den Heuvel") XCTAssertEqual(inst.subject?.reference, "Patient/f001") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -132,10 +132,10 @@ class DiagnosticReportTests: XCTestCase { XCTAssertEqual(inst.issued?.description, "2012-12-01T12:00:00+01:00") XCTAssertEqual(inst.performer?[0].display, "Blijdorp MC") XCTAssertEqual(inst.performer?[0].reference, "Organization/f203") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, DiagnosticReportStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.display, "Roel") XCTAssertEqual(inst.subject?.reference, "Patient/f201") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -175,10 +175,10 @@ class DiagnosticReportTests: XCTestCase { XCTAssertEqual(inst.request?[0].reference, "#req") XCTAssertEqual(inst.result?[0].display, "Results for staphylococcus analysis on Roel's blood culture") XCTAssertEqual(inst.result?[0].reference, "Observation/f206") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, DiagnosticReportStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.display, "Roel") XCTAssertEqual(inst.subject?.reference, "Patient/f201") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -230,9 +230,9 @@ class DiagnosticReportTests: XCTestCase { XCTAssertEqual(inst.specimen?[1].reference, "#ltt") XCTAssertEqual(inst.specimen?[2].display, "Urine Sample") XCTAssertEqual(inst.specimen?[2].reference, "#urine") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, DiagnosticReportStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.reference, "Patient/pat2") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -272,9 +272,9 @@ class DiagnosticReportTests: XCTestCase { XCTAssertEqual(inst.result?[1].reference, "#triglyceride") XCTAssertEqual(inst.result?[2].reference, "#hdlcholesterol") XCTAssertEqual(inst.result?[3].reference, "#ldlcholesterol") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, DiagnosticReportStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.reference, "Patient/pat2") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -299,9 +299,9 @@ class DiagnosticReportTests: XCTestCase { XCTAssertEqual(inst.id, "pap") XCTAssertEqual(inst.issued?.description, "2013-02-13T11:45:33+11:00") XCTAssertEqual(inst.performer?[0].reference, "Practitioner/example") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, DiagnosticReportStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.reference, "Patient/b248b1b2-1686-4b94-9936-37d7a5f94b51") - XCTAssertEqual(inst.text?.status, "additional") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "additional")!) return inst } @@ -337,9 +337,9 @@ class DiagnosticReportTests: XCTestCase { XCTAssertEqual(inst.image?[0].link?.reference, "Media/1.2.840.11361907579238403408700.3.0.14.19970327150033") XCTAssertEqual(inst.issued?.description, "2012-12-01T12:00:00+01:00") XCTAssertEqual(inst.performer?[0].reference, "Practitioner/example") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, DiagnosticReportStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -397,9 +397,9 @@ class DiagnosticReportTests: XCTestCase { XCTAssertEqual(inst.result?[7].reference, "#r8") XCTAssertEqual(inst.result?[8].reference, "#r9") XCTAssertEqual(inst.result?[9].reference, "#r10") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, DiagnosticReportStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.reference, "Patient/pat2") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -440,10 +440,10 @@ class DiagnosticReportTests: XCTestCase { XCTAssertEqual(inst.result?[1].reference, "Observation/ob-genetics-3-2") XCTAssertEqual(inst.specimen?[0].display, "Molecular Specimen ID: MLD45-Z4-1234") XCTAssertEqual(inst.specimen?[0].reference, "Specimen/genetics-example2") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, DiagnosticReportStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.display, "Peter James Chalmers(MRN: 12345)") XCTAssertEqual(inst.subject?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/DiagnosticRequestTests.swift b/Tests/ModelTests/DiagnosticRequestTests.swift index 892080db..5cde7ccb 100644 --- a/Tests/ModelTests/DiagnosticRequestTests.swift +++ b/Tests/ModelTests/DiagnosticRequestTests.swift @@ -2,7 +2,7 @@ // DiagnosticRequestTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -46,7 +46,7 @@ class DiagnosticRequestTests: XCTestCase { XCTAssertEqual(inst.stage?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/request-stage") XCTAssertEqual(inst.status, "active") XCTAssertEqual(inst.subject?.reference, "Patient/dicom") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -75,7 +75,7 @@ class DiagnosticRequestTests: XCTestCase { XCTAssertEqual(inst.stage?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/request-stage") XCTAssertEqual(inst.status, "active") XCTAssertEqual(inst.subject?.reference, "Patient/pat2") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -117,7 +117,7 @@ class DiagnosticRequestTests: XCTestCase { XCTAssertEqual(inst.status, "active") XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.supportingInformation?[0].reference, "#fasting") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -148,7 +148,7 @@ class DiagnosticRequestTests: XCTestCase { XCTAssertEqual(inst.stage?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/request-stage") XCTAssertEqual(inst.status, "active") XCTAssertEqual(inst.subject?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/DocumentReferenceTests.swift b/Tests/ModelTests/DocumentReferenceTests.swift index 34fa8498..a4260911 100644 --- a/Tests/ModelTests/DocumentReferenceTests.swift +++ b/Tests/ModelTests/DocumentReferenceTests.swift @@ -2,7 +2,7 @@ // DocumentReferenceTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -34,12 +34,12 @@ class DocumentReferenceTests: XCTestCase { func runDocumentReference1(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.DocumentReference { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "documentreference-example.json") + XCTAssertEqual(inst.`class`?.coding?[0].code, "History and Physical") + XCTAssertEqual(inst.`class`?.coding?[0].display, "History and Physical") + XCTAssertEqual(inst.`class`?.coding?[0].system?.absoluteString, "http://ihe.net/xds/connectathon/classCodes") XCTAssertEqual(inst.authenticator?.reference, "Organization/organization-example") XCTAssertEqual(inst.author?[0].reference, "Practitioner/xcda1") XCTAssertEqual(inst.author?[1].reference, "#a2") - XCTAssertEqual(inst.class_fhir?.coding?[0].code, "History and Physical") - XCTAssertEqual(inst.class_fhir?.coding?[0].display, "History and Physical") - XCTAssertEqual(inst.class_fhir?.coding?[0].system?.absoluteString, "http://ihe.net/xds/connectathon/classCodes") XCTAssertEqual(inst.contained?[0].id, "a2") XCTAssertEqual(inst.content?[0].attachment?.contentType, "application/hl7-v3+xml") XCTAssertEqual(inst.content?[0].attachment?.hash, Base64Binary(value: "2jmj7l5rSw0yVb/vlWAYkK/YBwk=")) @@ -77,14 +77,14 @@ class DocumentReferenceTests: XCTestCase { XCTAssertEqual(inst.indexed?.description, "2005-12-24T09:43:41+11:00") XCTAssertEqual(inst.masterIdentifier?.system?.absoluteString, "urn:ietf:rfc:3986") XCTAssertEqual(inst.masterIdentifier?.value, "urn:oid:1.3.6.1.4.1.21367.2005.3.7") - XCTAssertEqual(inst.relatesTo?[0].code, "appends") + XCTAssertEqual(inst.relatesTo?[0].code, DocumentRelationshipType(rawValue: "appends")!) XCTAssertEqual(inst.relatesTo?[0].target?.reference, "DocumentReference/example") XCTAssertEqual(inst.securityLabel?[0].coding?[0].code, "V") XCTAssertEqual(inst.securityLabel?[0].coding?[0].display, "very restricted") XCTAssertEqual(inst.securityLabel?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/Confidentiality") - XCTAssertEqual(inst.status, "current") + XCTAssertEqual(inst.status, DocumentReferenceStatus(rawValue: "current")!) XCTAssertEqual(inst.subject?.reference, "Patient/xcda") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "34108-1") XCTAssertEqual(inst.type?.coding?[0].display, "Outpatient Note") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://loinc.org") diff --git a/Tests/ModelTests/EligibilityRequestTests.swift b/Tests/ModelTests/EligibilityRequestTests.swift index 68d73a9d..1018efa6 100644 --- a/Tests/ModelTests/EligibilityRequestTests.swift +++ b/Tests/ModelTests/EligibilityRequestTests.swift @@ -2,7 +2,7 @@ // EligibilityRequestTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -43,9 +43,9 @@ class EligibilityRequestTests: XCTestCase { XCTAssertEqual(inst.organization?.reference, "Organization/1") XCTAssertEqual(inst.patient?.reference, "Patient/pat1") XCTAssertEqual(inst.priority?.code, "normal") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, EligibilityRequestStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the EligibilityRequest
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/EligibilityResponseTests.swift b/Tests/ModelTests/EligibilityResponseTests.swift index eec19a1f..3e3ec8e4 100644 --- a/Tests/ModelTests/EligibilityResponseTests.swift +++ b/Tests/ModelTests/EligibilityResponseTests.swift @@ -2,7 +2,7 @@ // EligibilityResponseTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -126,9 +126,9 @@ class EligibilityResponseTests: XCTestCase { XCTAssertEqual(inst.organization?.reference, "Organization/2") XCTAssertEqual(inst.outcome, "complete") XCTAssertEqual(inst.request?.reference, "http://www.BenefitsInc.com/fhir/eligibility/225476332402") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, EligibilityResponseStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the EligibilityResponse.
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -157,9 +157,9 @@ class EligibilityResponseTests: XCTestCase { XCTAssertEqual(inst.outcome, "complete") XCTAssertEqual(inst.request?.reference, "http://www.BenefitsInc.com/fhir/eligibility/225476332402") XCTAssertEqual(inst.requestOrganization?.reference, "Organization/1") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, EligibilityResponseStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the EligibilityResponse.
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/EncounterTests.swift b/Tests/ModelTests/EncounterTests.swift index 9f91ba85..4fa3d745 100644 --- a/Tests/ModelTests/EncounterTests.swift +++ b/Tests/ModelTests/EncounterTests.swift @@ -2,7 +2,7 @@ // EncounterTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -34,9 +34,9 @@ class EncounterTests: XCTestCase { func runEncounter1(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Encounter { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "encounter-example-f001-heart.json") - XCTAssertEqual(inst.class_fhir?.code, "AMB") - XCTAssertEqual(inst.class_fhir?.display, "ambulatory") - XCTAssertEqual(inst.class_fhir?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") + XCTAssertEqual(inst.`class`?.code, "AMB") + XCTAssertEqual(inst.`class`?.display, "ambulatory") + XCTAssertEqual(inst.`class`?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") XCTAssertEqual(inst.hospitalization?.admitSource?.coding?[0].code, "305956004") XCTAssertEqual(inst.hospitalization?.admitSource?.coding?[0].display, "Referral by physician") XCTAssertEqual(inst.hospitalization?.admitSource?.coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -44,11 +44,11 @@ class EncounterTests: XCTestCase { XCTAssertEqual(inst.hospitalization?.dischargeDisposition?.coding?[0].display, "Discharge to home") XCTAssertEqual(inst.hospitalization?.dischargeDisposition?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.hospitalization?.preAdmissionIdentifier?.system?.absoluteString, "http://www.amc.nl/zorgportal/identifiers/pre-admissions") - XCTAssertEqual(inst.hospitalization?.preAdmissionIdentifier?.use, "official") + XCTAssertEqual(inst.hospitalization?.preAdmissionIdentifier?.use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.hospitalization?.preAdmissionIdentifier?.value, "93042") XCTAssertEqual(inst.id, "f001") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://www.amc.nl/zorgportal/identifiers/visits") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "v1451") XCTAssertEqual(inst.length?.code, "min") XCTAssertEqual(inst.length?.system?.absoluteString, "http://unitsofmeasure.org") @@ -66,8 +66,8 @@ class EncounterTests: XCTestCase { XCTAssertEqual(inst.reason?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.serviceProvider?.display, "Burgers University Medical Center") XCTAssertEqual(inst.serviceProvider?.reference, "Organization/f001") - XCTAssertEqual(inst.status, "finished") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, EncounterStatus(rawValue: "finished")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?[0].coding?[0].code, "270427003") XCTAssertEqual(inst.type?[0].coding?[0].display, "Patient-initiated encounter") XCTAssertEqual(inst.type?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -89,9 +89,9 @@ class EncounterTests: XCTestCase { func runEncounter2(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Encounter { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "encounter-example-f002-lung.json") - XCTAssertEqual(inst.class_fhir?.code, "AMB") - XCTAssertEqual(inst.class_fhir?.display, "ambulatory") - XCTAssertEqual(inst.class_fhir?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") + XCTAssertEqual(inst.`class`?.code, "AMB") + XCTAssertEqual(inst.`class`?.display, "ambulatory") + XCTAssertEqual(inst.`class`?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") XCTAssertEqual(inst.hospitalization?.admitSource?.coding?[0].code, "305997006") XCTAssertEqual(inst.hospitalization?.admitSource?.coding?[0].display, "Referral by radiologist") XCTAssertEqual(inst.hospitalization?.admitSource?.coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -99,11 +99,11 @@ class EncounterTests: XCTestCase { XCTAssertEqual(inst.hospitalization?.dischargeDisposition?.coding?[0].display, "Discharge to home") XCTAssertEqual(inst.hospitalization?.dischargeDisposition?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.hospitalization?.preAdmissionIdentifier?.system?.absoluteString, "http://www.bmc.nl/zorgportal/identifiers/pre-admissions") - XCTAssertEqual(inst.hospitalization?.preAdmissionIdentifier?.use, "official") + XCTAssertEqual(inst.hospitalization?.preAdmissionIdentifier?.use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.hospitalization?.preAdmissionIdentifier?.value, "98682") XCTAssertEqual(inst.id, "f002") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://www.bmc.nl/zorgportal/identifiers/encounters") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "v3251") XCTAssertEqual(inst.length?.code, "min") XCTAssertEqual(inst.length?.system?.absoluteString, "http://unitsofmeasure.org") @@ -121,8 +121,8 @@ class EncounterTests: XCTestCase { XCTAssertEqual(inst.reason?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.serviceProvider?.display, "BMC") XCTAssertEqual(inst.serviceProvider?.reference, "Organization/f001") - XCTAssertEqual(inst.status, "finished") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, EncounterStatus(rawValue: "finished")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?[0].coding?[0].code, "270427003") XCTAssertEqual(inst.type?[0].coding?[0].display, "Patient-initiated encounter") XCTAssertEqual(inst.type?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -144,9 +144,9 @@ class EncounterTests: XCTestCase { func runEncounter3(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Encounter { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "encounter-example-f003-abscess.json") - XCTAssertEqual(inst.class_fhir?.code, "AMB") - XCTAssertEqual(inst.class_fhir?.display, "ambulatory") - XCTAssertEqual(inst.class_fhir?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") + XCTAssertEqual(inst.`class`?.code, "AMB") + XCTAssertEqual(inst.`class`?.display, "ambulatory") + XCTAssertEqual(inst.`class`?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") XCTAssertEqual(inst.hospitalization?.admitSource?.coding?[0].code, "305956004") XCTAssertEqual(inst.hospitalization?.admitSource?.coding?[0].display, "Referral by physician") XCTAssertEqual(inst.hospitalization?.admitSource?.coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -154,11 +154,11 @@ class EncounterTests: XCTestCase { XCTAssertEqual(inst.hospitalization?.dischargeDisposition?.coding?[0].display, "Discharge to home") XCTAssertEqual(inst.hospitalization?.dischargeDisposition?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.hospitalization?.preAdmissionIdentifier?.system?.absoluteString, "http://www.bmc.nl/zorgportal/identifiers/pre-admissions") - XCTAssertEqual(inst.hospitalization?.preAdmissionIdentifier?.use, "official") + XCTAssertEqual(inst.hospitalization?.preAdmissionIdentifier?.use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.hospitalization?.preAdmissionIdentifier?.value, "93042") XCTAssertEqual(inst.id, "f003") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://www.bmc.nl/zorgportal/identifiers/encounters") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "v6751") XCTAssertEqual(inst.length?.code, "min") XCTAssertEqual(inst.length?.system?.absoluteString, "http://unitsofmeasure.org") @@ -177,8 +177,8 @@ class EncounterTests: XCTestCase { XCTAssertEqual(inst.reason?[0].extension_fhir?[0].url?.absoluteString, "http://hl7.org/fhir/StructureDefinition/encounter-primaryDiagnosis") XCTAssertEqual(inst.reason?[0].extension_fhir?[0].valuePositiveInt, UInt(1)) XCTAssertEqual(inst.serviceProvider?.reference, "Organization/f001") - XCTAssertEqual(inst.status, "finished") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, EncounterStatus(rawValue: "finished")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?[0].coding?[0].code, "270427003") XCTAssertEqual(inst.type?[0].coding?[0].display, "Patient-initiated encounter") XCTAssertEqual(inst.type?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -200,11 +200,11 @@ class EncounterTests: XCTestCase { func runEncounter4(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Encounter { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "encounter-example-f201-20130404.json") - XCTAssertEqual(inst.class_fhir?.code, "AMB") - XCTAssertEqual(inst.class_fhir?.display, "ambulatory") - XCTAssertEqual(inst.class_fhir?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") + XCTAssertEqual(inst.`class`?.code, "AMB") + XCTAssertEqual(inst.`class`?.display, "ambulatory") + XCTAssertEqual(inst.`class`?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") XCTAssertEqual(inst.id, "f201") - XCTAssertEqual(inst.identifier?[0].use, "temp") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "temp")!) XCTAssertEqual(inst.identifier?[0].value, "Encounter_Roel_20130404") XCTAssertEqual(inst.participant?[0].individual?.reference, "Practitioner/f201") XCTAssertEqual(inst.patient?.display, "Roel") @@ -214,8 +214,8 @@ class EncounterTests: XCTestCase { XCTAssertEqual(inst.priority?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.reason?[0].text, "The patient had fever peaks over the last couple of days. He is worried about these peaks.") XCTAssertEqual(inst.serviceProvider?.reference, "Organization/f201") - XCTAssertEqual(inst.status, "finished") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, EncounterStatus(rawValue: "finished")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?[0].coding?[0].code, "11429006") XCTAssertEqual(inst.type?[0].coding?[0].display, "Consultation") XCTAssertEqual(inst.type?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -237,11 +237,11 @@ class EncounterTests: XCTestCase { func runEncounter5(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Encounter { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "encounter-example-f202-20130128.json") - XCTAssertEqual(inst.class_fhir?.code, "AMB") - XCTAssertEqual(inst.class_fhir?.display, "ambulatory") - XCTAssertEqual(inst.class_fhir?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") + XCTAssertEqual(inst.`class`?.code, "AMB") + XCTAssertEqual(inst.`class`?.display, "ambulatory") + XCTAssertEqual(inst.`class`?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") XCTAssertEqual(inst.id, "f202") - XCTAssertEqual(inst.identifier?[0].use, "temp") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "temp")!) XCTAssertEqual(inst.identifier?[0].value, "Encounter_Roel_20130128") XCTAssertEqual(inst.indication?[0].display, "Roel's TPF chemotherapy on January 28th, 2013") XCTAssertEqual(inst.indication?[0].extension_fhir?[0].url?.absoluteString, "http://hl7.org/fhir/StructureDefinition/encounter-primaryDiagnosis") @@ -261,8 +261,8 @@ class EncounterTests: XCTestCase { XCTAssertEqual(inst.reason?[0].extension_fhir?[0].valuePositiveInt, UInt(2)) XCTAssertEqual(inst.reason?[0].text, "The patient is treated for a tumor.") XCTAssertEqual(inst.serviceProvider?.reference, "Organization/f201") - XCTAssertEqual(inst.status, "finished") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, EncounterStatus(rawValue: "finished")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?[0].coding?[0].code, "367336001") XCTAssertEqual(inst.type?[0].coding?[0].display, "Chemotherapy") XCTAssertEqual(inst.type?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -284,11 +284,11 @@ class EncounterTests: XCTestCase { func runEncounter6(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Encounter { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "encounter-example-f203-20130311.json") + XCTAssertEqual(inst.`class`?.code, "IMP") + XCTAssertEqual(inst.`class`?.display, "inpatient encounter") + XCTAssertEqual(inst.`class`?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") XCTAssertEqual(inst.account?[0].reference, "Account/example") XCTAssertEqual(inst.appointment?.reference, "Appointment/example") - XCTAssertEqual(inst.class_fhir?.code, "IMP") - XCTAssertEqual(inst.class_fhir?.display, "inpatient encounter") - XCTAssertEqual(inst.class_fhir?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") XCTAssertEqual(inst.episodeOfCare?[0].reference, "EpisodeOfCare/example") XCTAssertEqual(inst.hospitalization?.admitSource?.coding?[0].code, "309902002") XCTAssertEqual(inst.hospitalization?.admitSource?.coding?[0].display, "Clinical Oncology Department") @@ -308,7 +308,7 @@ class EncounterTests: XCTestCase { XCTAssertEqual(inst.hospitalization?.specialCourtesy?[0].coding?[0].display, "normal courtesy") XCTAssertEqual(inst.hospitalization?.specialCourtesy?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/EncounterSpecialCourtesy") XCTAssertEqual(inst.id, "f203") - XCTAssertEqual(inst.identifier?[0].use, "temp") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "temp")!) XCTAssertEqual(inst.identifier?[0].value, "Encounter_Roel_20130311") XCTAssertEqual(inst.incomingReferral?[0].reference, "ReferralRequest/example") XCTAssertEqual(inst.partOf?.reference, "Encounter/f203") @@ -324,10 +324,10 @@ class EncounterTests: XCTestCase { XCTAssertEqual(inst.priority?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.reason?[0].text, "The patient seems to suffer from bilateral pneumonia and renal insufficiency, most likely due to chemotherapy.") XCTAssertEqual(inst.serviceProvider?.reference, "Organization/2") - XCTAssertEqual(inst.status, "finished") + XCTAssertEqual(inst.status, EncounterStatus(rawValue: "finished")!) XCTAssertEqual(inst.statusHistory?[0].period?.start?.description, "2013-03-08") - XCTAssertEqual(inst.statusHistory?[0].status, "arrived") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.statusHistory?[0].status, EncounterStatus(rawValue: "arrived")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?[0].coding?[0].code, "183807002") XCTAssertEqual(inst.type?[0].coding?[0].display, "Inpatient stay for nine days") XCTAssertEqual(inst.type?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -349,16 +349,16 @@ class EncounterTests: XCTestCase { func runEncounter7(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Encounter { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "encounter-example-home.json") - XCTAssertEqual(inst.class_fhir?.code, "HH") - XCTAssertEqual(inst.class_fhir?.display, "home health") - XCTAssertEqual(inst.class_fhir?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") + XCTAssertEqual(inst.`class`?.code, "HH") + XCTAssertEqual(inst.`class`?.display, "home health") + XCTAssertEqual(inst.`class`?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") XCTAssertEqual(inst.contained?[0].id, "home") XCTAssertEqual(inst.id, "home") XCTAssertEqual(inst.location?[0].location?.display, "Client's home") XCTAssertEqual(inst.location?[0].location?.reference, "#home") XCTAssertEqual(inst.location?[0].period?.end?.description, "2015-01-17T16:30:00+10:00") XCTAssertEqual(inst.location?[0].period?.start?.description, "2015-01-17T16:00:00+10:00") - XCTAssertEqual(inst.location?[0].status, "completed") + XCTAssertEqual(inst.location?[0].status, EncounterLocationStatus(rawValue: "completed")!) XCTAssertEqual(inst.participant?[0].individual?.display, "Dr Adam Careful") XCTAssertEqual(inst.participant?[0].individual?.reference, "Practitioner/example") XCTAssertEqual(inst.participant?[0].period?.end?.description, "2015-01-17T16:30:00+10:00") @@ -366,9 +366,9 @@ class EncounterTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/example") XCTAssertEqual(inst.period?.end?.description, "2015-01-17T16:30:00+10:00") XCTAssertEqual(inst.period?.start?.description, "2015-01-17T16:00:00+10:00") - XCTAssertEqual(inst.status, "finished") + XCTAssertEqual(inst.status, EncounterStatus(rawValue: "finished")!) XCTAssertEqual(inst.text?.div, "
Encounter with patient @example who is at home
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -387,20 +387,20 @@ class EncounterTests: XCTestCase { func runEncounter8(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Encounter { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "encounter-example-xcda.json") - XCTAssertEqual(inst.class_fhir?.code, "AMB") - XCTAssertEqual(inst.class_fhir?.display, "ambulatory") - XCTAssertEqual(inst.class_fhir?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") + XCTAssertEqual(inst.`class`?.code, "AMB") + XCTAssertEqual(inst.`class`?.display, "ambulatory") + XCTAssertEqual(inst.`class`?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") XCTAssertEqual(inst.id, "xcda") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://healthcare.example.org/identifiers/enocunter") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "1234213.52345873") XCTAssertEqual(inst.participant?[0].individual?.reference, "Practitioner/xcda1") XCTAssertEqual(inst.patient?.reference, "Patient/xcda") XCTAssertEqual(inst.reason?[0].coding?[0].code, "T-D8200") XCTAssertEqual(inst.reason?[0].coding?[0].display, "Arm") XCTAssertEqual(inst.reason?[0].coding?[0].system?.absoluteString, "http://ihe.net/xds/connectathon/eventCodes") - XCTAssertEqual(inst.status, "finished") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, EncounterStatus(rawValue: "finished")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -419,14 +419,14 @@ class EncounterTests: XCTestCase { func runEncounter9(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Encounter { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "encounter-example.json") - XCTAssertEqual(inst.class_fhir?.code, "IMP") - XCTAssertEqual(inst.class_fhir?.display, "inpatient encounter") - XCTAssertEqual(inst.class_fhir?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") + XCTAssertEqual(inst.`class`?.code, "IMP") + XCTAssertEqual(inst.`class`?.display, "inpatient encounter") + XCTAssertEqual(inst.`class`?.system?.absoluteString, "http://hl7.org/fhir/v3/ActCode") XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.status, "in-progress") + XCTAssertEqual(inst.status, EncounterStatus(rawValue: "in-progress")!) XCTAssertEqual(inst.text?.div, "
Encounter with patient @example
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/EndpointTests.swift b/Tests/ModelTests/EndpointTests.swift index a8b0af7b..7d784a2d 100644 --- a/Tests/ModelTests/EndpointTests.swift +++ b/Tests/ModelTests/EndpointTests.swift @@ -2,7 +2,7 @@ // EndpointTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -37,8 +37,8 @@ class EndpointTests: XCTestCase { XCTAssertEqual(inst.address?.absoluteString, "http://fhir3.healthintersections.com.au/open/CarePlan") XCTAssertEqual(inst.connectionType?.code, "hl7-fhir-rest") XCTAssertEqual(inst.connectionType?.system?.absoluteString, "http://hl7.org/fhir/endpoint-connection-type") - XCTAssertEqual(inst.contact?[0].system, "email") - XCTAssertEqual(inst.contact?[0].use, "work") + XCTAssertEqual(inst.contact?[0].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.contact?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.contact?[0].value, "endpointmanager@example.org") XCTAssertEqual(inst.header?[0], "bearer-code BASGS534s4") XCTAssertEqual(inst.id, "example") @@ -50,8 +50,8 @@ class EndpointTests: XCTestCase { XCTAssertEqual(inst.payloadType?[0].coding?[0].code, "CarePlan") XCTAssertEqual(inst.payloadType?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/resource-types") XCTAssertEqual(inst.period?.start?.description, "2014-09-01") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, EndpointStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/EnrollmentRequestTests.swift b/Tests/ModelTests/EnrollmentRequestTests.swift index e7e0ad10..33a84454 100644 --- a/Tests/ModelTests/EnrollmentRequestTests.swift +++ b/Tests/ModelTests/EnrollmentRequestTests.swift @@ -2,7 +2,7 @@ // EnrollmentRequestTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -40,10 +40,10 @@ class EnrollmentRequestTests: XCTestCase { XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://happyvalley.com/enrollmentrequest") XCTAssertEqual(inst.identifier?[0].value, "EN22345") XCTAssertEqual(inst.organizationReference?.reference, "Organization/1") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, EnrollmentRequestStatus(rawValue: "active")!) XCTAssertEqual(inst.subjectReference?.reference, "Patient/1") XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the EnrollmentRequest.
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/EnrollmentResponseTests.swift b/Tests/ModelTests/EnrollmentResponseTests.swift index 48facaec..813f9756 100644 --- a/Tests/ModelTests/EnrollmentResponseTests.swift +++ b/Tests/ModelTests/EnrollmentResponseTests.swift @@ -2,7 +2,7 @@ // EnrollmentResponseTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -42,9 +42,9 @@ class EnrollmentResponseTests: XCTestCase { XCTAssertEqual(inst.organizationReference?.reference, "Organization/2") XCTAssertEqual(inst.outcome, "complete") XCTAssertEqual(inst.requestReference?.reference, "http://www.BenefitsInc.com/fhir/eligibility/225476332402") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, EnrollmentResponseStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the EnrollmentResponse
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/EpisodeOfCareTests.swift b/Tests/ModelTests/EpisodeOfCareTests.swift index 869523b2..f320fc0e 100644 --- a/Tests/ModelTests/EpisodeOfCareTests.swift +++ b/Tests/ModelTests/EpisodeOfCareTests.swift @@ -2,7 +2,7 @@ // EpisodeOfCareTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -47,21 +47,21 @@ class EpisodeOfCareTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/example") XCTAssertEqual(inst.period?.start?.description, "2014-09-01") XCTAssertEqual(inst.referralRequest?[0].display, "Referral from Example Aged Care Services") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, EpisodeOfCareStatus(rawValue: "active")!) XCTAssertEqual(inst.statusHistory?[0].period?.end?.description, "2014-09-14") XCTAssertEqual(inst.statusHistory?[0].period?.start?.description, "2014-09-01") - XCTAssertEqual(inst.statusHistory?[0].status, "planned") + XCTAssertEqual(inst.statusHistory?[0].status, EpisodeOfCareStatus(rawValue: "planned")!) XCTAssertEqual(inst.statusHistory?[1].period?.end?.description, "2014-09-21") XCTAssertEqual(inst.statusHistory?[1].period?.start?.description, "2014-09-15") - XCTAssertEqual(inst.statusHistory?[1].status, "active") + XCTAssertEqual(inst.statusHistory?[1].status, EpisodeOfCareStatus(rawValue: "active")!) XCTAssertEqual(inst.statusHistory?[2].period?.end?.description, "2014-09-24") XCTAssertEqual(inst.statusHistory?[2].period?.start?.description, "2014-09-22") - XCTAssertEqual(inst.statusHistory?[2].status, "onhold") + XCTAssertEqual(inst.statusHistory?[2].status, EpisodeOfCareStatus(rawValue: "onhold")!) XCTAssertEqual(inst.statusHistory?[3].period?.start?.description, "2014-09-25") - XCTAssertEqual(inst.statusHistory?[3].status, "active") + XCTAssertEqual(inst.statusHistory?[3].status, EpisodeOfCareStatus(rawValue: "active")!) XCTAssertEqual(inst.team?[0].display, "example care team") XCTAssertEqual(inst.team?[0].reference, "CareTeam/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?[0].coding?[0].code, "HACC") XCTAssertEqual(inst.type?[0].coding?[0].display, "Home and Community Care Package") XCTAssertEqual(inst.type?[0].coding?[0].system?.absoluteString, "http://example.org/EpisodeOfCare/Type") diff --git a/Tests/ModelTests/ExpansionProfileTests.swift b/Tests/ModelTests/ExpansionProfileTests.swift index 551d4799..0d78b8a2 100644 --- a/Tests/ModelTests/ExpansionProfileTests.swift +++ b/Tests/ModelTests/ExpansionProfileTests.swift @@ -2,7 +2,7 @@ // ExpansionProfileTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -37,9 +37,9 @@ class ExpansionProfileTests: XCTestCase { XCTAssertTrue(inst.excludeNested ?? false) XCTAssertTrue(inst.experimental ?? false) XCTAssertEqual(inst.id, "example") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) XCTAssertEqual(inst.text?.div, "
[ Provide Rendering ]
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/ExplanationOfBenefitTests.swift b/Tests/ModelTests/ExplanationOfBenefitTests.swift index 93512cd1..ce5c2d44 100644 --- a/Tests/ModelTests/ExplanationOfBenefitTests.swift +++ b/Tests/ModelTests/ExplanationOfBenefitTests.swift @@ -2,7 +2,7 @@ // ExplanationOfBenefitTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -67,9 +67,9 @@ class ExplanationOfBenefitTests: XCTestCase { XCTAssertEqual(inst.outcome?.code, "complete") XCTAssertEqual(inst.outcome?.system?.absoluteString, "http://hl7.org/fhir/remittance-outcome") XCTAssertEqual(inst.patient?.reference, "Patient/pat1") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ExplanationOfBenefitStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the ExplanationOfBenefit
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.totalBenefit?.code, "USD") XCTAssertEqual(inst.totalBenefit?.system?.absoluteString, "urn:iso:std:iso:4217") XCTAssertEqual(inst.totalBenefit?.value, NSDecimalNumber(string: "96.0")) diff --git a/Tests/ModelTests/FamilyMemberHistoryTests.swift b/Tests/ModelTests/FamilyMemberHistoryTests.swift index 79342b1e..c2435b56 100644 --- a/Tests/ModelTests/FamilyMemberHistoryTests.swift +++ b/Tests/ModelTests/FamilyMemberHistoryTests.swift @@ -2,7 +2,7 @@ // FamilyMemberHistoryTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -47,9 +47,9 @@ class FamilyMemberHistoryTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/100") XCTAssertEqual(inst.relationship?.coding?[0].code, "mother") XCTAssertEqual(inst.relationship?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/familial-relationship") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, FamilyHistoryStatus(rawValue: "completed")!) XCTAssertEqual(inst.text?.div, "
Mother died of a stroke aged 56
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -83,9 +83,9 @@ class FamilyMemberHistoryTests: XCTestCase { XCTAssertEqual(inst.patient?.reference, "Patient/example") XCTAssertEqual(inst.relationship?.coding?[0].code, "father") XCTAssertEqual(inst.relationship?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/familial-relationship") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, FamilyHistoryStatus(rawValue: "completed")!) XCTAssertEqual(inst.text?.div, "
Father died of a heart attack aged 74
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/FlagTests.swift b/Tests/ModelTests/FlagTests.swift index 606eae7b..a1ad5e1f 100644 --- a/Tests/ModelTests/FlagTests.swift +++ b/Tests/ModelTests/FlagTests.swift @@ -2,7 +2,7 @@ // FlagTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -42,11 +42,11 @@ class FlagTests: XCTestCase { XCTAssertEqual(inst.code?.coding?[0].system?.absoluteString, "http://example.org/local/if1") XCTAssertEqual(inst.encounter?.reference, "Encounter/example") XCTAssertEqual(inst.id, "example-encounter") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, FlagStatus(rawValue: "active")!) XCTAssertEqual(inst.subject?.display, "Peter Patient") XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.text?.div, "
Follow Infection Control Level 3 Protocol
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -76,11 +76,11 @@ class FlagTests: XCTestCase { XCTAssertEqual(inst.code?.coding?[0].system?.absoluteString, "http://example.org/local") XCTAssertEqual(inst.code?.text, "Patient has a big dog at his home. Always always wear a suit of armor or take other active counter-measures") XCTAssertEqual(inst.id, "example") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, FlagStatus(rawValue: "active")!) XCTAssertEqual(inst.subject?.display, "Peter Patient") XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.text?.div, "
Large Dog warning for Peter Patient
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/GoalTests.swift b/Tests/ModelTests/GoalTests.swift index 4b36f657..d7fcc34d 100644 --- a/Tests/ModelTests/GoalTests.swift +++ b/Tests/ModelTests/GoalTests.swift @@ -2,7 +2,7 @@ // GoalTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -52,10 +52,10 @@ class GoalTests: XCTestCase { XCTAssertEqual(inst.extension_fhir?[0].extension_fhir?[1].valueRange?.low?.value, NSDecimalNumber(string: "160")) XCTAssertEqual(inst.extension_fhir?[0].url?.absoluteString, "http://hl7.org/fhir/StructureDefinition/goal-target") XCTAssertEqual(inst.id, "example") - XCTAssertEqual(inst.status, "in-progress") + XCTAssertEqual(inst.status, GoalStatus(rawValue: "in-progress")!) XCTAssertEqual(inst.subject?.display, "Peter James Chalmers") XCTAssertEqual(inst.subject?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "additional") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "additional")!) return inst } diff --git a/Tests/ModelTests/GroupTests.swift b/Tests/ModelTests/GroupTests.swift index 6d5ab3ce..4e8b2755 100644 --- a/Tests/ModelTests/GroupTests.swift +++ b/Tests/ModelTests/GroupTests.swift @@ -2,7 +2,7 @@ // GroupTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -45,8 +45,8 @@ class GroupTests: XCTestCase { XCTAssertEqual(inst.member?[2].period?.start?.description, "2015-08-06") XCTAssertEqual(inst.member?[3].entity?.reference, "Patient/pat4") XCTAssertEqual(inst.member?[3].period?.start?.description, "2015-08-06") - XCTAssertEqual(inst.text?.status, "additional") - XCTAssertEqual(inst.type, "person") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "additional")!) + XCTAssertEqual(inst.type, GroupType(rawValue: "person")!) return inst } @@ -76,8 +76,8 @@ class GroupTests: XCTestCase { XCTAssertEqual(inst.id, "101") XCTAssertEqual(inst.name, "John's herd") XCTAssertEqual(inst.quantity, UInt(25)) - XCTAssertEqual(inst.text?.status, "additional") - XCTAssertEqual(inst.type, "animal") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "additional")!) + XCTAssertEqual(inst.type, GroupType(rawValue: "animal")!) return inst } diff --git a/Tests/ModelTests/GuidanceResponseTests.swift b/Tests/ModelTests/GuidanceResponseTests.swift index 4980858b..6f680d8f 100644 --- a/Tests/ModelTests/GuidanceResponseTests.swift +++ b/Tests/ModelTests/GuidanceResponseTests.swift @@ -2,7 +2,7 @@ // GuidanceResponseTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -36,9 +36,9 @@ class GuidanceResponseTests: XCTestCase { XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.module?.reference, "ServiceDefinition/example") - XCTAssertEqual(inst.status, "success") + XCTAssertEqual(inst.status, GuidanceResponseStatus(rawValue: "success")!) XCTAssertEqual(inst.text?.div, "
[Put rendering here]
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/HealthcareServiceTests.swift b/Tests/ModelTests/HealthcareServiceTests.swift index 2d4bddea..4b063cec 100644 --- a/Tests/ModelTests/HealthcareServiceTests.swift +++ b/Tests/ModelTests/HealthcareServiceTests.swift @@ -2,7 +2,7 @@ // HealthcareServiceTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -39,15 +39,15 @@ class HealthcareServiceTests: XCTestCase { XCTAssertEqual(inst.availabilityExceptions, "Reduced capacity is available during the Christmas period") XCTAssertEqual(inst.availableTime?[0].availableEndTime?.description, "05:30:00") XCTAssertEqual(inst.availableTime?[0].availableStartTime?.description, "08:30:00") - XCTAssertEqual(inst.availableTime?[0].daysOfWeek?[0], "mon") - XCTAssertEqual(inst.availableTime?[0].daysOfWeek?[1], "tue") - XCTAssertEqual(inst.availableTime?[0].daysOfWeek?[2], "wed") - XCTAssertEqual(inst.availableTime?[0].daysOfWeek?[3], "thu") - XCTAssertEqual(inst.availableTime?[0].daysOfWeek?[4], "fri") + XCTAssertEqual(inst.availableTime?[0].daysOfWeek?[0], DaysOfWeek(rawValue: "mon")!) + XCTAssertEqual(inst.availableTime?[0].daysOfWeek?[1], DaysOfWeek(rawValue: "tue")!) + XCTAssertEqual(inst.availableTime?[0].daysOfWeek?[2], DaysOfWeek(rawValue: "wed")!) + XCTAssertEqual(inst.availableTime?[0].daysOfWeek?[3], DaysOfWeek(rawValue: "thu")!) + XCTAssertEqual(inst.availableTime?[0].daysOfWeek?[4], DaysOfWeek(rawValue: "fri")!) XCTAssertEqual(inst.availableTime?[1].availableEndTime?.description, "04:30:00") XCTAssertEqual(inst.availableTime?[1].availableStartTime?.description, "09:30:00") - XCTAssertEqual(inst.availableTime?[1].daysOfWeek?[0], "sat") - XCTAssertEqual(inst.availableTime?[1].daysOfWeek?[1], "fri") + XCTAssertEqual(inst.availableTime?[1].daysOfWeek?[0], DaysOfWeek(rawValue: "sat")!) + XCTAssertEqual(inst.availableTime?[1].daysOfWeek?[1], DaysOfWeek(rawValue: "fri")!) XCTAssertEqual(inst.characteristic?[0].coding?[0].display, "Wheelchair access") XCTAssertEqual(inst.comment, "Providing Specialist psychology services to the greater Den Burg area, many years of experience dealing with PTSD issues") XCTAssertEqual(inst.contained?[0].id, "DenBurg") @@ -83,13 +83,13 @@ class HealthcareServiceTests: XCTestCase { XCTAssertEqual(inst.specialty?[0].coding?[0].code, "47505003") XCTAssertEqual(inst.specialty?[0].coding?[0].display, "Posttraumatic stress disorder") XCTAssertEqual(inst.specialty?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "(555) silent") - XCTAssertEqual(inst.telecom?[1].system, "email") - XCTAssertEqual(inst.telecom?[1].use, "work") + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.telecom?[1].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[1].value, "directaddress@example.com") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/ImagingManifestTests.swift b/Tests/ModelTests/ImagingManifestTests.swift index e1c08cf9..526f7d6c 100644 --- a/Tests/ModelTests/ImagingManifestTests.swift +++ b/Tests/ModelTests/ImagingManifestTests.swift @@ -2,7 +2,7 @@ // ImagingManifestTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -56,7 +56,7 @@ class ImagingManifestTests: XCTestCase { XCTAssertEqual(inst.study?[0].series?[1].uid, "urn:oid:2.16.124.113543.6003.189642796.63084.16750.2599092902") XCTAssertEqual(inst.study?[0].uid, "urn:oid:2.16.124.113543.6003.189642796.63084.16749.2599092904") XCTAssertEqual(inst.text?.div, "
A set of images to share accompanying an report document, including one SC image and two CT image
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.title?.coding?[0].code, "113030") XCTAssertEqual(inst.title?.coding?[0].display, "Manifest") XCTAssertEqual(inst.title?.coding?[0].system?.absoluteString, "http://nema.org/dicom/dicm") diff --git a/Tests/ModelTests/ImagingStudyTests.swift b/Tests/ModelTests/ImagingStudyTests.swift index cde1337e..9d3d935a 100644 --- a/Tests/ModelTests/ImagingStudyTests.swift +++ b/Tests/ModelTests/ImagingStudyTests.swift @@ -2,7 +2,7 @@ // ImagingStudyTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -52,7 +52,7 @@ class ImagingStudyTests: XCTestCase { XCTAssertEqual(inst.series?[0].uid, "urn:oid:2.16.124.113543.6003.2588828330.45298.17418.2723805630") XCTAssertEqual(inst.started?.description, "2011-01-01T11:01:20+03:00") XCTAssertEqual(inst.text?.div, "
CT Chest. John Smith (MRN: 09236). Accession: W12342398. Performed: 2011-01-01. 3 series, 12 images.
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.uid, "urn:oid:2.16.124.113543.6003.1154777499.30246.19789.3503430045") return inst diff --git a/Tests/ModelTests/ImmunizationRecommendationTests.swift b/Tests/ModelTests/ImmunizationRecommendationTests.swift index ae4dc284..32394fc8 100644 --- a/Tests/ModelTests/ImmunizationRecommendationTests.swift +++ b/Tests/ModelTests/ImmunizationRecommendationTests.swift @@ -2,7 +2,7 @@ // ImmunizationRecommendationTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -63,7 +63,7 @@ class ImmunizationRecommendationTests: XCTestCase { XCTAssertEqual(inst.recommendation?[0].vaccineCode?.coding?[0].display, "Hepatitis A vaccine") XCTAssertEqual(inst.recommendation?[0].vaccineCode?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.text?.div, "
Authored by Joginder Madra
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/ImmunizationTests.swift b/Tests/ModelTests/ImmunizationTests.swift index fb9322e4..5b95b83b 100644 --- a/Tests/ModelTests/ImmunizationTests.swift +++ b/Tests/ModelTests/ImmunizationTests.swift @@ -2,7 +2,7 @@ // ImmunizationTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -41,8 +41,8 @@ class ImmunizationTests: XCTestCase { XCTAssertEqual(inst.id, "notGiven") XCTAssertEqual(inst.patient?.reference, "Patient/example") XCTAssertFalse(inst.reported ?? true) - XCTAssertEqual(inst.status, "completed") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, MedicationAdministrationStatus(rawValue: "completed")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.vaccineCode?.coding?[0].code, "01") XCTAssertEqual(inst.vaccineCode?.coding?[0].display, "DTP") XCTAssertEqual(inst.vaccineCode?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/sid/cvx") @@ -93,8 +93,8 @@ class ImmunizationTests: XCTestCase { XCTAssertEqual(inst.site?.coding?[0].code, "LA") XCTAssertEqual(inst.site?.coding?[0].display, "left arm") XCTAssertEqual(inst.site?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/ActSite") - XCTAssertEqual(inst.status, "completed") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, MedicationAdministrationStatus(rawValue: "completed")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.vaccinationProtocol?[0].authority?.reference, "Organization/hl7") XCTAssertEqual(inst.vaccinationProtocol?[0].description_fhir, "Vaccination Protocol Sequence 1") XCTAssertEqual(inst.vaccinationProtocol?[0].doseSequence, UInt(1)) diff --git a/Tests/ModelTests/ImplementationGuideTests.swift b/Tests/ModelTests/ImplementationGuideTests.swift index 609b2fee..1eb6bf10 100644 --- a/Tests/ModelTests/ImplementationGuideTests.swift +++ b/Tests/ModelTests/ImplementationGuideTests.swift @@ -2,7 +2,7 @@ // ImplementationGuideTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -36,14 +36,14 @@ class ImplementationGuideTests: XCTestCase { XCTAssertEqual(inst.binary?[0].absoluteString, "http://h7.org/fhir/fhir.css") XCTAssertEqual(inst.contact?[0].name, "ONC") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "http://www.healthit.gov") XCTAssertEqual(inst.contact?[1].name, "HL7") - XCTAssertEqual(inst.contact?[1].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[1].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[1].telecom?[0].value, "http://hl7.org/fhir") XCTAssertEqual(inst.copyright, "Published by ONC under the standard FHIR license (CC0)") XCTAssertEqual(inst.date?.description, "2015-01-01") - XCTAssertEqual(inst.dependency?[0].type, "reference") + XCTAssertEqual(inst.dependency?[0].type, GuideDependencyType(rawValue: "reference")!) XCTAssertEqual(inst.dependency?[0].uri?.absoluteString, "http://hl7.org/fhir/ImplementationGuide/uscore") XCTAssertFalse(inst.experimental ?? true) XCTAssertEqual(inst.fhirVersion, "1.0.0") @@ -61,9 +61,9 @@ class ImplementationGuideTests: XCTestCase { XCTAssertEqual(inst.package?[0].resource?[0].exampleFor?.reference, "StructureDefinition/daf-patient") XCTAssertEqual(inst.package?[0].resource?[0].name, "Test Example") XCTAssertEqual(inst.package?[0].resource?[0].sourceUri?.absoluteString, "test.html") - XCTAssertEqual(inst.page?.kind, "page") + XCTAssertEqual(inst.page?.kind, GuidePageKind(rawValue: "page")!) XCTAssertEqual(inst.page?.page?[0].format, "text/html") - XCTAssertEqual(inst.page?.page?[0].kind, "list") + XCTAssertEqual(inst.page?.page?[0].kind, GuidePageKind(rawValue: "list")!) XCTAssertEqual(inst.page?.page?[0].package?[0], "test") XCTAssertEqual(inst.page?.page?[0].source?.absoluteString, "list.html") XCTAssertEqual(inst.page?.page?[0].title, "Value Set Page") @@ -71,8 +71,8 @@ class ImplementationGuideTests: XCTestCase { XCTAssertEqual(inst.page?.source?.absoluteString, "patient-example.html") XCTAssertEqual(inst.page?.title, "Example Patient Page") XCTAssertEqual(inst.publisher, "ONC / HL7 Joint project") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/daf") XCTAssertEqual(inst.version, "0") diff --git a/Tests/ModelTests/LibraryTests.swift b/Tests/ModelTests/LibraryTests.swift index deb13130..b1811f3e 100644 --- a/Tests/ModelTests/LibraryTests.swift +++ b/Tests/ModelTests/LibraryTests.swift @@ -2,7 +2,7 @@ // LibraryTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -80,13 +80,13 @@ class LibraryTests: XCTestCase { XCTAssertEqual(inst.date?.description, "2015-07-22") XCTAssertEqual(inst.description_fhir, "Logic for CMS 146: Appropriate Testing for Children with Pharyngitis") XCTAssertEqual(inst.id, "library-cms146-example") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "CMS146") XCTAssertEqual(inst.relatedArtifact?[0].resource?.reference, "Library/library-quick-model-definition") - XCTAssertEqual(inst.relatedArtifact?[0].type, "depends-on") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.relatedArtifact?[0].type, RelatedArtifactType(rawValue: "depends-on")!) + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) XCTAssertEqual(inst.text?.div, "
CMS 146 Logic
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.title, "Appropriate Testing for Children with Pharyngitis") XCTAssertEqual(inst.type?.coding?[0].code, "logic-library") XCTAssertEqual(inst.version, "2.0.0") @@ -116,13 +116,13 @@ class LibraryTests: XCTestCase { XCTAssertEqual(inst.date?.description, "2015-07-22") XCTAssertEqual(inst.description_fhir, "Common Logic for adherence to Chlamydia Screening guidelines") XCTAssertEqual(inst.id, "example") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "ChalmydiaScreening_Common") XCTAssertEqual(inst.relatedArtifact?[0].resource?.reference, "Library/library-quick-model-definition") - XCTAssertEqual(inst.relatedArtifact?[0].type, "depends-on") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.relatedArtifact?[0].type, RelatedArtifactType(rawValue: "depends-on")!) + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) XCTAssertEqual(inst.text?.div, "
Chlamydia Screening Common Library
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.title, "Chlamydia Screening Common Library") XCTAssertEqual(inst.topic?[0].text, "Chlamydia Screening") XCTAssertEqual(inst.type?.coding?[0].code, "logic-library") diff --git a/Tests/ModelTests/LinkageTests.swift b/Tests/ModelTests/LinkageTests.swift index 625043ad..620b40c1 100644 --- a/Tests/ModelTests/LinkageTests.swift +++ b/Tests/ModelTests/LinkageTests.swift @@ -2,7 +2,7 @@ // LinkageTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -37,11 +37,11 @@ class LinkageTests: XCTestCase { XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.item?[0].resource?.display, "Severe burn of left ear (Date: 24-May 2012)") XCTAssertEqual(inst.item?[0].resource?.reference, "Condition/example") - XCTAssertEqual(inst.item?[0].type, "source") + XCTAssertEqual(inst.item?[0].type, LinkageType(rawValue: "source")!) XCTAssertEqual(inst.item?[1].resource?.display, "Severe burn of left ear (Date: 24-May 2012)") XCTAssertEqual(inst.item?[1].resource?.reference, "Condition/condition-example") - XCTAssertEqual(inst.item?[1].type, "alternate") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.item?[1].type, LinkageType(rawValue: "alternate")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/ListTests.swift b/Tests/ModelTests/ListTests.swift index 302d3543..b78652ee 100644 --- a/Tests/ModelTests/ListTests.swift +++ b/Tests/ModelTests/ListTests.swift @@ -2,7 +2,7 @@ // ListTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -42,12 +42,12 @@ class ListTests: XCTestCase { XCTAssertEqual(inst.entry?[0].item?.reference, "AllergyIntolerance/example") XCTAssertEqual(inst.entry?[1].item?.reference, "AllergyIntolerance/medication") XCTAssertEqual(inst.id, "current-allergies") - XCTAssertEqual(inst.mode, "working") + XCTAssertEqual(inst.mode, ListMode(rawValue: "working")!) XCTAssertEqual(inst.orderedBy?.coding?[0].code, "entry-date") XCTAssertEqual(inst.orderedBy?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/list-order") XCTAssertEqual(inst.source?.reference, "Patient/example") - XCTAssertEqual(inst.status, "current") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, ListStatus(rawValue: "current")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.title, "Current Allergy List") return inst @@ -77,10 +77,10 @@ class ListTests: XCTestCase { XCTAssertEqual(inst.emptyReason?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/list-empty-reason") XCTAssertEqual(inst.emptyReason?.text, "The patient is not on any medications") XCTAssertEqual(inst.id, "example-empty") - XCTAssertEqual(inst.mode, "snapshot") + XCTAssertEqual(inst.mode, ListMode(rawValue: "snapshot")!) XCTAssertEqual(inst.source?.reference, "Patient/example") - XCTAssertEqual(inst.status, "current") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, ListStatus(rawValue: "current")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -107,12 +107,12 @@ class ListTests: XCTestCase { XCTAssertEqual(inst.entry?[0].item?.reference, "#fmh-1") XCTAssertEqual(inst.entry?[1].item?.reference, "#fmh-2") XCTAssertEqual(inst.id, "f201") - XCTAssertEqual(inst.mode, "snapshot") + XCTAssertEqual(inst.mode, ListMode(rawValue: "snapshot")!) XCTAssertEqual(inst.note?[0].text, "Both parents, both brothers and both children (twin) are still alive.") - XCTAssertEqual(inst.status, "current") + XCTAssertEqual(inst.status, ListStatus(rawValue: "current")!) XCTAssertEqual(inst.subject?.display, "Roel") XCTAssertEqual(inst.subject?.reference, "Patient/f201") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -155,11 +155,11 @@ class ListTests: XCTestCase { XCTAssertEqual(inst.entry?[8].item?.reference, "#9") XCTAssertEqual(inst.entry?[9].item?.reference, "#10") XCTAssertEqual(inst.id, "prognosis") - XCTAssertEqual(inst.mode, "snapshot") - XCTAssertEqual(inst.status, "current") + XCTAssertEqual(inst.mode, ListMode(rawValue: "snapshot")!) + XCTAssertEqual(inst.status, ListStatus(rawValue: "current")!) XCTAssertEqual(inst.subject?.display, "Annie Proband, female, born 1966") XCTAssertEqual(inst.subject?.reference, "Patient/proband") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -198,12 +198,12 @@ class ListTests: XCTestCase { XCTAssertEqual(inst.entry?[6].item?.reference, "#7") XCTAssertEqual(inst.entry?[7].item?.reference, "#8") XCTAssertEqual(inst.id, "genetic") - XCTAssertEqual(inst.mode, "snapshot") - XCTAssertEqual(inst.status, "current") + XCTAssertEqual(inst.mode, ListMode(rawValue: "snapshot")!) + XCTAssertEqual(inst.status, ListStatus(rawValue: "current")!) XCTAssertEqual(inst.subject?.display, "Peter Patient") XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.text?.div, "
To do
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -237,10 +237,10 @@ class ListTests: XCTestCase { XCTAssertEqual(inst.entry?[1].flag?.coding?[0].system?.absoluteString, "http://nehta.gov.au/codes/medications/changetype") XCTAssertEqual(inst.entry?[1].item?.display, "Morphine Sulfate") XCTAssertEqual(inst.id, "med-list") - XCTAssertEqual(inst.mode, "changes") + XCTAssertEqual(inst.mode, ListMode(rawValue: "changes")!) XCTAssertEqual(inst.source?.reference, "Patient/example") - XCTAssertEqual(inst.status, "current") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, ListStatus(rawValue: "current")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -264,9 +264,9 @@ class ListTests: XCTestCase { XCTAssertEqual(inst.code?.coding?[0].system?.absoluteString, "http://acme.com/list-codes") XCTAssertEqual(inst.date?.description, "2016-07-14T11:54:05+10:00") XCTAssertEqual(inst.id, "example-simple-empty") - XCTAssertEqual(inst.mode, "snapshot") - XCTAssertEqual(inst.status, "current") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.mode, ListMode(rawValue: "snapshot")!) + XCTAssertEqual(inst.status, ListStatus(rawValue: "current")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -296,11 +296,11 @@ class ListTests: XCTestCase { XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:uuid:a9fcea7c-fcdf-4d17-a5e0-f26dda030b59") XCTAssertEqual(inst.identifier?[0].value, "23974652") - XCTAssertEqual(inst.mode, "changes") + XCTAssertEqual(inst.mode, ListMode(rawValue: "changes")!) XCTAssertEqual(inst.source?.reference, "Patient/example") - XCTAssertEqual(inst.status, "current") + XCTAssertEqual(inst.status, ListStatus(rawValue: "current")!) XCTAssertEqual(inst.subject?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/LocationTests.swift b/Tests/ModelTests/LocationTests.swift index 4fb88a0f..1d50fdd7 100644 --- a/Tests/ModelTests/LocationTests.swift +++ b/Tests/ModelTests/LocationTests.swift @@ -2,7 +2,7 @@ // LocationTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -37,17 +37,17 @@ class LocationTests: XCTestCase { XCTAssertEqual(inst.description_fhir, "Ambulance provided by Burgers University Medical Center") XCTAssertEqual(inst.id, "amb") XCTAssertEqual(inst.managingOrganization?.reference, "Organization/f001") - XCTAssertEqual(inst.mode, "kind") + XCTAssertEqual(inst.mode, LocationMode(rawValue: "kind")!) XCTAssertEqual(inst.name, "BUMC Ambulance") XCTAssertEqual(inst.physicalType?.coding?[0].code, "ve") XCTAssertEqual(inst.physicalType?.coding?[0].display, "Vehicle") XCTAssertEqual(inst.physicalType?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/location-physical-type") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "mobile") + XCTAssertEqual(inst.status, LocationStatus(rawValue: "active")!) + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "mobile")!) XCTAssertEqual(inst.telecom?[0].value, "2329") XCTAssertEqual(inst.text?.div, "
Mobile Clinic
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "AMB") XCTAssertEqual(inst.type?.coding?[0].display, "Ambulance") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/RoleCode") @@ -76,21 +76,21 @@ class LocationTests: XCTestCase { XCTAssertEqual(inst.address?.state, "MI") XCTAssertEqual(inst.description_fhir, "HL7 Headquarters") XCTAssertEqual(inst.id, "hl7") - XCTAssertEqual(inst.mode, "instance") + XCTAssertEqual(inst.mode, LocationMode(rawValue: "instance")!) XCTAssertEqual(inst.name, "Health Level Seven International") XCTAssertEqual(inst.physicalType?.coding?[0].code, "bu") XCTAssertEqual(inst.physicalType?.coding?[0].display, "Building") XCTAssertEqual(inst.physicalType?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/location-physical-type") XCTAssertEqual(inst.position?.latitude, NSDecimalNumber(string: "-83.69471")) XCTAssertEqual(inst.position?.longitude, NSDecimalNumber(string: "42.2565")) - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.telecom?[0].system, "phone") + XCTAssertEqual(inst.status, LocationStatus(rawValue: "active")!) + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) XCTAssertEqual(inst.telecom?[0].value, "(+1) 734-677-7777") - XCTAssertEqual(inst.telecom?[1].system, "fax") + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "fax")!) XCTAssertEqual(inst.telecom?[1].value, "(+1) 734-677-6622") - XCTAssertEqual(inst.telecom?[2].system, "email") + XCTAssertEqual(inst.telecom?[2].system, ContactPointSystem(rawValue: "email")!) XCTAssertEqual(inst.telecom?[2].value, "hq@HL7.org") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "SLEEP") XCTAssertEqual(inst.type?.coding?[0].display, "Sleep disorders unit") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/RoleCode") @@ -115,14 +115,14 @@ class LocationTests: XCTestCase { XCTAssertEqual(inst.description_fhir, "Patient's Home") XCTAssertEqual(inst.id, "ph") XCTAssertEqual(inst.managingOrganization?.reference, "Organization/f001") - XCTAssertEqual(inst.mode, "kind") + XCTAssertEqual(inst.mode, LocationMode(rawValue: "kind")!) XCTAssertEqual(inst.name, "Patient's Home") XCTAssertEqual(inst.physicalType?.coding?[0].code, "ho") XCTAssertEqual(inst.physicalType?.coding?[0].display, "House") XCTAssertEqual(inst.physicalType?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/location-physical-type") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, LocationStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
Patient's Home
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "PTRES") XCTAssertEqual(inst.type?.coding?[0].display, "Patient's Residence") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/RoleCode") @@ -150,17 +150,17 @@ class LocationTests: XCTestCase { XCTAssertEqual(inst.id, "2") XCTAssertEqual(inst.identifier?[0].value, "B1-S.F2.1.00") XCTAssertEqual(inst.managingOrganization?.reference, "Organization/f001") - XCTAssertEqual(inst.mode, "instance") + XCTAssertEqual(inst.mode, LocationMode(rawValue: "instance")!) XCTAssertEqual(inst.name, "South Wing Neuro OR 1") XCTAssertEqual(inst.partOf?.reference, "Location/1") XCTAssertEqual(inst.physicalType?.coding?[0].code, "ro") XCTAssertEqual(inst.physicalType?.coding?[0].display, "Room") XCTAssertEqual(inst.physicalType?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/location-physical-type") - XCTAssertEqual(inst.status, "suspended") - XCTAssertEqual(inst.telecom?[0].system, "phone") + XCTAssertEqual(inst.status, LocationStatus(rawValue: "suspended")!) + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) XCTAssertEqual(inst.telecom?[0].value, "2329") XCTAssertEqual(inst.text?.div, "
Burgers UMC, South Wing, second floor, Neuro Radiology Operation Room 1
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "RNEU") XCTAssertEqual(inst.type?.coding?[0].display, "Neuroradiology unit") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/RoleCode") @@ -184,14 +184,14 @@ class LocationTests: XCTestCase { XCTAssertEqual(inst.description_fhir, "All Pharmacies in the United Kingdom covered by the National Pharmacy Association") XCTAssertEqual(inst.id, "ukp") - XCTAssertEqual(inst.mode, "kind") + XCTAssertEqual(inst.mode, LocationMode(rawValue: "kind")!) XCTAssertEqual(inst.name, "UK Pharmacies") XCTAssertEqual(inst.physicalType?.coding?[0].code, "jdn") XCTAssertEqual(inst.physicalType?.coding?[0].display, "Jurisdiction") XCTAssertEqual(inst.physicalType?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/location-physical-type") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, LocationStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
UK Pharmacies
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "PHARM") XCTAssertEqual(inst.type?.coding?[0].display, "Pharmacy") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/RoleCode") @@ -217,7 +217,7 @@ class LocationTests: XCTestCase { XCTAssertEqual(inst.address?.country, "NLD") XCTAssertEqual(inst.address?.line?[0], "Galapagosweg 91, Building A") XCTAssertEqual(inst.address?.postalCode, "9105 PZ") - XCTAssertEqual(inst.address?.use, "work") + XCTAssertEqual(inst.address?.use, AddressUse(rawValue: "work")!) XCTAssertEqual(inst.description_fhir, "Second floor of the Old South Wing, formerly in use by Psychiatry") XCTAssertEqual(inst.endpoint?[0].reference, "Endpoint/example") XCTAssertEqual(inst.extension_fhir?[0].url?.absoluteString, "http://hl7.org/fhir/StructureDefinition/location-alias") @@ -227,7 +227,7 @@ class LocationTests: XCTestCase { XCTAssertEqual(inst.id, "1") XCTAssertEqual(inst.identifier?[0].value, "B1-S.F2") XCTAssertEqual(inst.managingOrganization?.reference, "Organization/f001") - XCTAssertEqual(inst.mode, "instance") + XCTAssertEqual(inst.mode, LocationMode(rawValue: "instance")!) XCTAssertEqual(inst.name, "South Wing, second floor") XCTAssertEqual(inst.physicalType?.coding?[0].code, "wi") XCTAssertEqual(inst.physicalType?.coding?[0].display, "Wing") @@ -235,20 +235,20 @@ class LocationTests: XCTestCase { XCTAssertEqual(inst.position?.altitude, NSDecimalNumber(string: "0")) XCTAssertEqual(inst.position?.latitude, NSDecimalNumber(string: "42.25475478")) XCTAssertEqual(inst.position?.longitude, NSDecimalNumber(string: "-83.6945691")) - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.status, LocationStatus(rawValue: "active")!) + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "2328") - XCTAssertEqual(inst.telecom?[1].system, "fax") - XCTAssertEqual(inst.telecom?[1].use, "work") + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "fax")!) + XCTAssertEqual(inst.telecom?[1].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[1].value, "2329") - XCTAssertEqual(inst.telecom?[2].system, "email") + XCTAssertEqual(inst.telecom?[2].system, ContactPointSystem(rawValue: "email")!) XCTAssertEqual(inst.telecom?[2].value, "second wing admissions") - XCTAssertEqual(inst.telecom?[3].system, "other") - XCTAssertEqual(inst.telecom?[3].use, "work") + XCTAssertEqual(inst.telecom?[3].system, ContactPointSystem(rawValue: "other")!) + XCTAssertEqual(inst.telecom?[3].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[3].value, "http://sampleorg.com/southwing") XCTAssertEqual(inst.text?.div, "
Burgers UMC, South Wing, second floor
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/MeasureReportTests.swift b/Tests/ModelTests/MeasureReportTests.swift index 57c4cb04..a6e11000 100644 --- a/Tests/ModelTests/MeasureReportTests.swift +++ b/Tests/ModelTests/MeasureReportTests.swift @@ -2,7 +2,7 @@ // MeasureReportTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -38,86 +38,86 @@ class MeasureReportTests: XCTestCase { XCTAssertEqual(inst.evaluatedResources?.reference, "Bundle/456") XCTAssertEqual(inst.group?[0].identifier?.value, "CMS146-group-1") XCTAssertEqual(inst.group?[0].population?[0].count, 1) - XCTAssertEqual(inst.group?[0].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].population?[1].count, 1) - XCTAssertEqual(inst.group?[0].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].population?[2].count, 1) - XCTAssertEqual(inst.group?[0].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].population?[3].count, 0) - XCTAssertEqual(inst.group?[0].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[0].count, 1) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[1].count, 1) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[2].count, 1) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[3].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].value, "true") XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[0].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[1].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[2].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[3].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].value, "false") XCTAssertEqual(inst.group?[0].stratifier?[0].identifier?.value, "stratifier-ages-up-to-9") XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[0].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[1].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[2].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[3].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].value, "true") XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[0].count, 1) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[1].count, 1) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[2].count, 1) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[3].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].value, "false") XCTAssertEqual(inst.group?[0].stratifier?[1].identifier?.value, "stratifier-ages-10-plus") XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[0].count, 1) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[1].count, 1) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[2].count, 1) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[3].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].value, "male") XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[0].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[1].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[2].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[3].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].value, "female") XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[0].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[1].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[2].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[3].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].value, "other") XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[0].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[1].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[2].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[3].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].value, "unknown") XCTAssertEqual(inst.group?[0].stratifier?[2].identifier?.value, "stratifier-gender") XCTAssertEqual(inst.group?[0].supplementalData?[0].group?[0].count, 1) @@ -140,9 +140,9 @@ class MeasureReportTests: XCTestCase { XCTAssertEqual(inst.period?.end?.description, "2014-03-31") XCTAssertEqual(inst.period?.start?.description, "2014-01-01") XCTAssertEqual(inst.reportingOrganization?.reference, "#reporter") - XCTAssertEqual(inst.status, "complete") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.type, "individual") + XCTAssertEqual(inst.status, MeasureReportStatus(rawValue: "complete")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.type, MeasureReportType(rawValue: "individual")!) return inst } @@ -165,121 +165,121 @@ class MeasureReportTests: XCTestCase { XCTAssertEqual(inst.group?[0].identifier?.value, "CMS146-group-1") XCTAssertEqual(inst.group?[0].population?[0].count, 500) XCTAssertEqual(inst.group?[0].population?[0].patients?.reference, "List/CMS146-initial-population") - XCTAssertEqual(inst.group?[0].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].population?[1].count, 200) XCTAssertEqual(inst.group?[0].population?[1].patients?.reference, "List/CMS146-numerator") - XCTAssertEqual(inst.group?[0].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].population?[2].count, 500) XCTAssertEqual(inst.group?[0].population?[2].patients?.reference, "List/CMS146-denominator") - XCTAssertEqual(inst.group?[0].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].population?[3].count, 100) XCTAssertEqual(inst.group?[0].population?[3].patients?.reference, "List/CMS146-denominator-exclusions") - XCTAssertEqual(inst.group?[0].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[0].count, 250) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[0].patients?.reference, "List/CMS146-stratifier-ages-up-to-9-true-initial-population") - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[1].count, 100) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[1].patients?.reference, "List/CMS146-stratifier-ages-up-to-9-true-numerator") - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[2].count, 250) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[2].patients?.reference, "List/CMS146-stratifier-ages-up-to-9-true-denominator") - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[3].count, 50) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[3].patients?.reference, "List/CMS146-stratifier-ages-up-to-9-true-denominator-exclusions") - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].value, "true") XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[0].count, 250) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[0].patients?.reference, "List/CMS146-stratifier-ages-up-to-9-false-initial-population") - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[1].count, 100) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[1].patients?.reference, "List/CMS146-stratifier-ages-up-to-9-false-numerator") - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[2].count, 250) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[2].patients?.reference, "List/CMS146-stratifier-ages-up-to-9-false-denominator") - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[3].count, 50) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[3].patients?.reference, "List/CMS146-stratifier-ages-up-to-9-false-denominator-exclusions") - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].value, "false") XCTAssertEqual(inst.group?[0].stratifier?[0].identifier?.value, "stratifier-ages-up-to-9") XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[0].count, 250) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[0].patients?.reference, "List/CMS146-stratifier-ages-10-plus-true-initial-population") - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[1].count, 100) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[1].patients?.reference, "List/CMS146-stratifier-ages-10-plus-true-numerator") - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[2].count, 250) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[2].patients?.reference, "List/CMS146-stratifier-ages-10-plus-true-denominator") - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[3].count, 50) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[3].patients?.reference, "List/CMS146-stratifier-ages-10-plus-true-denominator-exclusions") - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].value, "true") XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[0].count, 250) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[0].patients?.reference, "List/CMS146-stratifier-ages-10-plus-false-initial-population") - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[1].count, 100) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[1].patients?.reference, "List/CMS146-stratifier-ages-10-plus-false-numerator") - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[2].count, 250) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[2].patients?.reference, "List/CMS146-stratifier-ages-10-plus-false-denominator") - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[3].count, 50) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[3].patients?.reference, "List/CMS146-stratifier-ages-10-plus-false-denominator-exclusions") - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].value, "false") XCTAssertEqual(inst.group?[0].stratifier?[1].identifier?.value, "stratifier-ages-10-plus") XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[0].count, 250) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[0].patients?.reference, "List/CMS146-stratifier-gender-male-initial-population") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[1].count, 100) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[1].patients?.reference, "List/CMS146-stratifier-gender-male-numerator") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[2].count, 250) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[2].patients?.reference, "List/CMS146-stratifier-gender-male-denominator") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[3].count, 50) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[3].patients?.reference, "List/CMS146-stratifier-gender-male-denominator-exclusions") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].value, "male") XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[0].count, 250) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[0].patients?.reference, "List/CMS146-stratifier-gender-female-initial-population") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[1].count, 100) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[1].patients?.reference, "List/CMS146-stratifier-gender-female-numerator") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[2].count, 250) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[2].patients?.reference, "List/CMS146-stratifier-gender-female-denominator") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[3].count, 50) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[3].patients?.reference, "List/CMS146-stratifier-gender-female-denominator-exclusions") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].value, "female") XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[0].count, 0) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[0].patients?.reference, "List/CMS146-stratifier-gender-other-initial-population") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[1].count, 0) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[1].patients?.reference, "List/CMS146-stratifier-gender-other-numerator") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[2].count, 0) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[2].patients?.reference, "List/CMS146-stratifier-gender-other-denominator") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[3].count, 0) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[3].patients?.reference, "List/CMS146-stratifier-gender-other-denominator-exclusions") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].value, "other") XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[0].count, 0) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[0].patients?.reference, "List/CMS146-stratifier-gender-unknown-initial-population") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[1].count, 0) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[1].patients?.reference, "List/CMS146-stratifier-gender-unknown-numerator") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[2].count, 0) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[2].patients?.reference, "List/CMS146-stratifier-gender-unknown-denominator") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[3].count, 0) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[3].patients?.reference, "List/CMS146-stratifier-gender-unknown-denominator-exclusions") - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].value, "unknown") XCTAssertEqual(inst.group?[0].stratifier?[2].identifier?.value, "stratifier-gender") XCTAssertEqual(inst.group?[0].supplementalData?[0].group?[0].count, 250) @@ -307,9 +307,9 @@ class MeasureReportTests: XCTestCase { XCTAssertEqual(inst.period?.end?.description, "2014-03-31") XCTAssertEqual(inst.period?.start?.description, "2014-01-01") XCTAssertEqual(inst.reportingOrganization?.reference, "#reporter") - XCTAssertEqual(inst.status, "complete") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.type, "patient-list") + XCTAssertEqual(inst.status, MeasureReportStatus(rawValue: "complete")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.type, MeasureReportType(rawValue: "patient-list")!) return inst } @@ -331,86 +331,86 @@ class MeasureReportTests: XCTestCase { XCTAssertEqual(inst.contained?[0].id, "reporter") XCTAssertEqual(inst.group?[0].identifier?.value, "CMS146-group-1") XCTAssertEqual(inst.group?[0].population?[0].count, 500) - XCTAssertEqual(inst.group?[0].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].population?[1].count, 200) - XCTAssertEqual(inst.group?[0].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].population?[2].count, 500) - XCTAssertEqual(inst.group?[0].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].population?[3].count, 100) - XCTAssertEqual(inst.group?[0].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[0].count, 250) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[1].count, 100) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[2].count, 250) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[3].count, 50) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[0].value, "true") XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[0].count, 250) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[1].count, 100) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[2].count, 250) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[3].count, 50) - XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[0].group?[1].value, "false") XCTAssertEqual(inst.group?[0].stratifier?[0].identifier?.value, "stratifier-ages-up-to-9") XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[0].count, 250) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[1].count, 100) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[2].count, 250) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[3].count, 50) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[0].value, "true") XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[0].count, 250) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[1].count, 100) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[2].count, 250) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[3].count, 50) - XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[1].group?[1].value, "false") XCTAssertEqual(inst.group?[0].stratifier?[1].identifier?.value, "stratifier-ages-10-plus") XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[0].count, 250) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[1].count, 100) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[2].count, 250) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[3].count, 50) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[0].value, "male") XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[0].count, 250) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[1].count, 100) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[2].count, 250) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[3].count, 50) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[1].value, "female") XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[0].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[1].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[2].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[3].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[2].value, "other") XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[0].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[0].type, "initial-population") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[0].type, MeasurePopulationType(rawValue: "initial-population")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[1].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[1].type, "numerator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[1].type, MeasurePopulationType(rawValue: "numerator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[2].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[2].type, "denominator") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[2].type, MeasurePopulationType(rawValue: "denominator")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[3].count, 0) - XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[3].type, "denominator-exclusion") + XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].population?[3].type, MeasurePopulationType(rawValue: "denominator-exclusion")!) XCTAssertEqual(inst.group?[0].stratifier?[2].group?[3].value, "unknown") XCTAssertEqual(inst.group?[0].stratifier?[2].identifier?.value, "stratifier-gender") XCTAssertEqual(inst.group?[0].supplementalData?[0].group?[0].count, 250) @@ -432,9 +432,9 @@ class MeasureReportTests: XCTestCase { XCTAssertEqual(inst.period?.end?.description, "2014-03-31") XCTAssertEqual(inst.period?.start?.description, "2014-01-01") XCTAssertEqual(inst.reportingOrganization?.reference, "#reporter") - XCTAssertEqual(inst.status, "complete") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.type, "summary") + XCTAssertEqual(inst.status, MeasureReportStatus(rawValue: "complete")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.type, MeasureReportType(rawValue: "summary")!) return inst } diff --git a/Tests/ModelTests/MediaTests.swift b/Tests/ModelTests/MediaTests.swift index 345d4abe..465f6a23 100644 --- a/Tests/ModelTests/MediaTests.swift +++ b/Tests/ModelTests/MediaTests.swift @@ -2,7 +2,7 @@ // MediaTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -42,7 +42,7 @@ class MediaTests: XCTestCase { XCTAssertEqual(inst.id, "1.2.840.11361907579238403408700.3.0.14.19970327150033") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:ietf:rfc:3986") XCTAssertEqual(inst.identifier?[0].type?.text, "InstanceUID") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "urn:oid:1.2.840.11361907579238403408700.3.0.14.19970327150033") XCTAssertEqual(inst.identifier?[1].system?.absoluteString, "http://acme-imaging.com/accession/2012") XCTAssertEqual(inst.identifier?[1].type?.text, "accessionNo") @@ -56,8 +56,8 @@ class MediaTests: XCTestCase { XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.subtype?.coding?[0].code, "US") XCTAssertEqual(inst.subtype?.coding?[0].system?.absoluteString, "http://nema.org/dicom/dicm") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.type, "photo") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.type, DigitalMediaType(rawValue: "photo")!) XCTAssertEqual(inst.view?.coding?[0].code, "399067008") XCTAssertEqual(inst.view?.coding?[0].display, "Lateral projection") XCTAssertEqual(inst.view?.coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -88,8 +88,8 @@ class MediaTests: XCTestCase { XCTAssertEqual(inst.operator_fhir?.reference, "Practitioner/xcda-author") XCTAssertEqual(inst.subject?.reference, "Patient/xcda") XCTAssertEqual(inst.text?.div, "
Sound recording of speech example for Patient Henry Levin (MRN 12345):
\"diagram\"/
") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.type, "video") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.type, DigitalMediaType(rawValue: "video")!) return inst } @@ -120,8 +120,8 @@ class MediaTests: XCTestCase { XCTAssertEqual(inst.subtype?.coding?[0].code, "diagram") XCTAssertEqual(inst.subtype?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/media-method") XCTAssertEqual(inst.text?.div, "
Diagram for Patient Henry Levin (MRN 12345):
\"diagram\"/
") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.type, "photo") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.type, DigitalMediaType(rawValue: "photo")!) XCTAssertEqual(inst.width, UInt(126)) return inst diff --git a/Tests/ModelTests/MessageHeaderTests.swift b/Tests/ModelTests/MessageHeaderTests.swift index 55f808d6..4556f015 100644 --- a/Tests/ModelTests/MessageHeaderTests.swift +++ b/Tests/ModelTests/MessageHeaderTests.swift @@ -2,7 +2,7 @@ // MessageHeaderTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -45,16 +45,16 @@ class MessageHeaderTests: XCTestCase { XCTAssertEqual(inst.id, "1cbdfb97-5859-48a4-8301-d54eab818d68") XCTAssertEqual(inst.reason?.coding?[0].code, "admit") XCTAssertEqual(inst.reason?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/message-reasons-encounter") - XCTAssertEqual(inst.response?.code, "ok") + XCTAssertEqual(inst.response?.code, ResponseType(rawValue: "ok")!) XCTAssertEqual(inst.response?.identifier, "5015fe84-8e76-4526-89d8-44b322e8d4fb") XCTAssertEqual(inst.responsible?.reference, "Practitioner/example") - XCTAssertEqual(inst.source?.contact?.system, "phone") + XCTAssertEqual(inst.source?.contact?.system, ContactPointSystem(rawValue: "phone")!) XCTAssertEqual(inst.source?.contact?.value, "+1 (555) 123 4567") XCTAssertEqual(inst.source?.endpoint?.absoluteString, "llp:10.11.12.13:5432") XCTAssertEqual(inst.source?.name, "Acme Central Patient Registry") XCTAssertEqual(inst.source?.software, "FooBar Patient Manager") XCTAssertEqual(inst.source?.version, "3.1.45.AABB") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.timestamp?.description, "2012-01-04T09:10:14Z") return inst diff --git a/Tests/ModelTests/NamingSystemTests.swift b/Tests/ModelTests/NamingSystemTests.swift index 4c7ea61e..633b7925 100644 --- a/Tests/ModelTests/NamingSystemTests.swift +++ b/Tests/ModelTests/NamingSystemTests.swift @@ -2,7 +2,7 @@ // NamingSystemTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -35,29 +35,29 @@ class NamingSystemTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "namingsystem-example-id.json") XCTAssertEqual(inst.contact?[0].name, "HL7 Australia FHIR Team") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "http://hl7-australia.wikispaces.com/FHIR+Australia") XCTAssertEqual(inst.date?.description, "2015-08-31") XCTAssertEqual(inst.description_fhir, "Australian HI Identifier as established by relevant regulations etc") XCTAssertEqual(inst.id, "example-id") XCTAssertEqual(inst.jurisdiction?[0].coding?[0].code, "AU") XCTAssertEqual(inst.jurisdiction?[0].coding?[0].system?.absoluteString, "urn:iso:std:iso:3166") - XCTAssertEqual(inst.kind, "identifier") + XCTAssertEqual(inst.kind, NamingSystemType(rawValue: "identifier")!) XCTAssertEqual(inst.name, "Austalian Healthcare Identifier - Individual") XCTAssertEqual(inst.publisher, "HL7 Australia on behalf of NEHTA") XCTAssertEqual(inst.responsible, "HI Service Operator / NEHTA") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "NI") XCTAssertEqual(inst.type?.coding?[0].display, "National unique individual identifier") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v2/0203") XCTAssertEqual(inst.type?.text, "IHI") XCTAssertEqual(inst.uniqueId?[0].comment, "This value is used in Australian CDA documents") - XCTAssertEqual(inst.uniqueId?[0].type, "oid") + XCTAssertEqual(inst.uniqueId?[0].type, NamingSystemIdentifierType(rawValue: "oid")!) XCTAssertEqual(inst.uniqueId?[0].value, "1.2.36.1.2001.1003.0") XCTAssertEqual(inst.uniqueId?[1].period?.start?.description, "2015-08-21") XCTAssertTrue(inst.uniqueId?[1].preferred ?? false) - XCTAssertEqual(inst.uniqueId?[1].type, "uri") + XCTAssertEqual(inst.uniqueId?[1].type, NamingSystemIdentifierType(rawValue: "uri")!) XCTAssertEqual(inst.uniqueId?[1].value, "http://ns.electronichealth.net.au/id/hi/ihi/1.0") XCTAssertEqual(inst.usage, "Used in Australia for identifying patients") @@ -81,13 +81,13 @@ class NamingSystemTests: XCTestCase { XCTAssertEqual(inst.date?.description, "2005-01-25") XCTAssertEqual(inst.description_fhir, "This was a wrong registration for the spanish editions of SNOMED CT. Do not use") XCTAssertEqual(inst.id, "example-replaced") - XCTAssertEqual(inst.kind, "codesystem") + XCTAssertEqual(inst.kind, NamingSystemType(rawValue: "codesystem")!) XCTAssertEqual(inst.name, "SNOMED CT Spanish") XCTAssertEqual(inst.publisher, "Not HL7!") XCTAssertEqual(inst.replacedBy?.reference, "NamingSystem/example") - XCTAssertEqual(inst.status, "retired") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.uniqueId?[0].type, "oid") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "retired")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.uniqueId?[0].type, NamingSystemIdentifierType(rawValue: "oid")!) XCTAssertEqual(inst.uniqueId?[0].value, "2.16.840.1.113883.6.96.1") return inst @@ -108,20 +108,20 @@ class NamingSystemTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "namingsystem-example.json") XCTAssertEqual(inst.contact?[0].name, "FHIR project team") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "http://hl7.org/fhir") XCTAssertEqual(inst.date?.description, "2014-12-13") XCTAssertEqual(inst.id, "example") - XCTAssertEqual(inst.kind, "codesystem") + XCTAssertEqual(inst.kind, NamingSystemType(rawValue: "codesystem")!) XCTAssertEqual(inst.name, "SNOMED CT") XCTAssertEqual(inst.publisher, "HL7 International on behalf of IHTSDO") XCTAssertEqual(inst.responsible, "IHTSDO & affiliates") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.uniqueId?[0].type, "oid") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.uniqueId?[0].type, NamingSystemIdentifierType(rawValue: "oid")!) XCTAssertEqual(inst.uniqueId?[0].value, "2.16.840.1.113883.6.96") XCTAssertTrue(inst.uniqueId?[1].preferred ?? false) - XCTAssertEqual(inst.uniqueId?[1].type, "uri") + XCTAssertEqual(inst.uniqueId?[1].type, NamingSystemIdentifierType(rawValue: "uri")!) XCTAssertEqual(inst.uniqueId?[1].value, "http://snomed.info/sct") return inst diff --git a/Tests/ModelTests/NutritionRequestTests.swift b/Tests/ModelTests/NutritionRequestTests.swift index 894b40db..2836a71e 100644 --- a/Tests/ModelTests/NutritionRequestTests.swift +++ b/Tests/ModelTests/NutritionRequestTests.swift @@ -2,7 +2,7 @@ // NutritionRequestTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -81,8 +81,8 @@ class NutritionRequestTests: XCTestCase { XCTAssertEqual(inst.orderer?.reference, "Practitioner/example") XCTAssertEqual(inst.patient?.display, "Peter Chalmers") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, NutritionOrderStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -137,8 +137,8 @@ class NutritionRequestTests: XCTestCase { XCTAssertEqual(inst.orderer?.reference, "Practitioner/example") XCTAssertEqual(inst.patient?.display, "Peter Chalmers") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, NutritionOrderStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -175,7 +175,7 @@ class NutritionRequestTests: XCTestCase { XCTAssertEqual(inst.orderer?.reference, "Practitioner/example") XCTAssertEqual(inst.patient?.display, "Peter Chalmers") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, NutritionOrderStatus(rawValue: "active")!) XCTAssertEqual(inst.supplement?[0].productName, "Glucerna") XCTAssertEqual(inst.supplement?[0].quantity?.unit, "8 oz bottle") XCTAssertEqual(inst.supplement?[0].quantity?.value, NSDecimalNumber(string: "1")) @@ -193,7 +193,7 @@ class NutritionRequestTests: XCTestCase { XCTAssertEqual(inst.supplement?[0].type?.coding?[1].display, "Adult diabetic formula") XCTAssertEqual(inst.supplement?[0].type?.coding?[1].system?.absoluteString, "http://goodhealthhospital.org/supplement-type-codes") XCTAssertEqual(inst.supplement?[0].type?.text, "Adult diabetic formula") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -230,7 +230,7 @@ class NutritionRequestTests: XCTestCase { XCTAssertEqual(inst.orderer?.reference, "Practitioner/example") XCTAssertEqual(inst.patient?.display, "Peter Chalmers") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, NutritionOrderStatus(rawValue: "active")!) XCTAssertEqual(inst.supplement?[0].productName, "Ensure") XCTAssertEqual(inst.supplement?[0].quantity?.unit, "8 oz can") XCTAssertEqual(inst.supplement?[0].quantity?.value, NSDecimalNumber(string: "1")) @@ -245,7 +245,7 @@ class NutritionRequestTests: XCTestCase { XCTAssertEqual(inst.supplement?[0].type?.coding?[1].display, "Adult high energy drink") XCTAssertEqual(inst.supplement?[0].type?.coding?[1].system?.absoluteString, "http://goodhealthhospital.org/supplement-type-codes") XCTAssertEqual(inst.supplement?[0].type?.text, "Adult high energy drink") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -310,8 +310,8 @@ class NutritionRequestTests: XCTestCase { XCTAssertEqual(inst.orderer?.reference, "Practitioner/example") XCTAssertEqual(inst.patient?.display, "Peter Chalmers") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, NutritionOrderStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -371,8 +371,8 @@ class NutritionRequestTests: XCTestCase { XCTAssertEqual(inst.orderer?.reference, "Practitioner/example") XCTAssertEqual(inst.patient?.display, "Peter Chalmers") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, NutritionOrderStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -434,8 +434,8 @@ class NutritionRequestTests: XCTestCase { XCTAssertEqual(inst.orderer?.reference, "Practitioner/example") XCTAssertEqual(inst.patient?.display, "Peter Chalmers") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, NutritionOrderStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -493,8 +493,8 @@ class NutritionRequestTests: XCTestCase { XCTAssertEqual(inst.orderer?.reference, "Practitioner/example") XCTAssertEqual(inst.patient?.display, "Peter Chalmers") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, NutritionOrderStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -523,7 +523,7 @@ class NutritionRequestTests: XCTestCase { XCTAssertEqual(inst.orderer?.reference, "Practitioner/example") XCTAssertEqual(inst.patient?.display, "Peter Chalmers") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, NutritionOrderStatus(rawValue: "active")!) XCTAssertEqual(inst.supplement?[0].instruction, "Beneprotein 1 scoop TID with meal.starting on 2015-02-10") XCTAssertEqual(inst.supplement?[0].productName, "Beneprotein") XCTAssertEqual(inst.supplement?[0].quantity?.code, "{scoop}") @@ -539,7 +539,7 @@ class NutritionRequestTests: XCTestCase { XCTAssertEqual(inst.supplement?[0].type?.coding?[1].display, "High Protein Powder") XCTAssertEqual(inst.supplement?[0].type?.coding?[1].system?.absoluteString, "http://goodhealthhospital.org/supplement-type-codes") XCTAssertEqual(inst.supplement?[0].type?.text, "High Protein Powder") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -585,7 +585,7 @@ class NutritionRequestTests: XCTestCase { XCTAssertEqual(inst.orderer?.reference, "Practitioner/example") XCTAssertEqual(inst.patient?.display, "Peter Chalmers") XCTAssertEqual(inst.patient?.reference, "Patient/example") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, NutritionOrderStatus(rawValue: "active")!) XCTAssertEqual(inst.supplement?[0].instruction, "Ensure Pudding at breakfast, lunch, supper") XCTAssertEqual(inst.supplement?[0].productName, "Ensure Pudding 4 oz container") XCTAssertEqual(inst.supplement?[0].type?.coding?[0].code, "442971000124100") @@ -595,7 +595,7 @@ class NutritionRequestTests: XCTestCase { XCTAssertEqual(inst.supplement?[0].type?.coding?[1].display, "Adult high energy pudding") XCTAssertEqual(inst.supplement?[0].type?.coding?[1].system?.absoluteString, "http://goodhealthhospital.org/supplement-type-codes") XCTAssertEqual(inst.supplement?[0].type?.text, "Adult high energy pudding") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/ObservationTests.swift b/Tests/ModelTests/ObservationTests.swift index 7be592a9..bacc6d98 100644 --- a/Tests/ModelTests/ObservationTests.swift +++ b/Tests/ModelTests/ObservationTests.swift @@ -2,7 +2,7 @@ // ObservationTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -123,9 +123,9 @@ class ObservationTests: XCTestCase { XCTAssertEqual(inst.effectiveDateTime?.description, "2016-05-18T22:33:22Z") XCTAssertEqual(inst.id, "10minute-apgar-score") XCTAssertEqual(inst.performer?[0].reference, "Practitioner/example") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, ObservationStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.reference, "Patient/infant") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.valueQuantity?.code, "{score}") XCTAssertEqual(inst.valueQuantity?.system?.absoluteString, "http://unitsofmeasure.org") XCTAssertEqual(inst.valueQuantity?.value, NSDecimalNumber(string: "10")) @@ -236,9 +236,9 @@ class ObservationTests: XCTestCase { XCTAssertEqual(inst.effectiveDateTime?.description, "2016-05-18T22:33:22Z") XCTAssertEqual(inst.id, "1minute-apgar-score") XCTAssertEqual(inst.performer?[0].reference, "Practitioner/example") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, ObservationStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.reference, "Patient/infant") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.valueQuantity?.code, "{score}") XCTAssertEqual(inst.valueQuantity?.system?.absoluteString, "http://unitsofmeasure.org") XCTAssertEqual(inst.valueQuantity?.value, NSDecimalNumber(string: "0")) @@ -331,9 +331,9 @@ class ObservationTests: XCTestCase { XCTAssertEqual(inst.effectiveDateTime?.description, "2016-05-18T22:33:22Z") XCTAssertEqual(inst.id, "20minute-apgar-score") XCTAssertEqual(inst.performer?[0].reference, "Practitioner/example") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, ObservationStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.reference, "Patient/infant") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.valueQuantity?.code, "{score}") XCTAssertEqual(inst.valueQuantity?.system?.absoluteString, "http://unitsofmeasure.org") XCTAssertEqual(inst.valueQuantity?.value, NSDecimalNumber(string: "10")) @@ -426,9 +426,9 @@ class ObservationTests: XCTestCase { XCTAssertEqual(inst.effectiveDateTime?.description, "2016-05-18T22:33:22Z") XCTAssertEqual(inst.id, "2minute-apgar-score") XCTAssertEqual(inst.performer?[0].reference, "Practitioner/example") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, ObservationStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.reference, "Patient/infant") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.valueQuantity?.code, "{score}") XCTAssertEqual(inst.valueQuantity?.system?.absoluteString, "http://unitsofmeasure.org") XCTAssertEqual(inst.valueQuantity?.value, NSDecimalNumber(string: "5")) @@ -539,9 +539,9 @@ class ObservationTests: XCTestCase { XCTAssertEqual(inst.effectiveDateTime?.description, "2016-05-18T22:33:22Z") XCTAssertEqual(inst.id, "5minute-apgar-score") XCTAssertEqual(inst.performer?[0].reference, "Practitioner/example") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, ObservationStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.reference, "Patient/infant") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.valueQuantity?.code, "{score}") XCTAssertEqual(inst.valueQuantity?.system?.absoluteString, "http://unitsofmeasure.org") XCTAssertEqual(inst.valueQuantity?.value, NSDecimalNumber(string: "10")) @@ -598,9 +598,9 @@ class ObservationTests: XCTestCase { XCTAssertEqual(inst.interpretation?.text, "Below low normal") XCTAssertEqual(inst.meta?.lastUpdated?.description, "2014-01-30T22:35:23+11:00") XCTAssertEqual(inst.performer?[0].reference, "Practitioner/example") - XCTAssertEqual(inst.status, "cancelled") + XCTAssertEqual(inst.status, ObservationStatus(rawValue: "cancelled")!) XCTAssertEqual(inst.subject?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -617,7 +617,7 @@ class ObservationTests: XCTestCase { @discardableResult func runObservation7(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Observation { - let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "observation-example-bloodpressure.json") + let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "observation-example-bloodpressure-dar.json") XCTAssertEqual(inst.bodySite?.coding?[0].code, "368209003") XCTAssertEqual(inst.bodySite?.coding?[0].display, "Right arm") @@ -644,23 +644,21 @@ class ObservationTests: XCTestCase { XCTAssertEqual(inst.component?[1].code?.coding?[0].code, "8462-4") XCTAssertEqual(inst.component?[1].code?.coding?[0].display, "Diastolic blood pressure") XCTAssertEqual(inst.component?[1].code?.coding?[0].system?.absoluteString, "http://loinc.org") - XCTAssertEqual(inst.component?[1].valueQuantity?.code, "mm[Hg]") - XCTAssertEqual(inst.component?[1].valueQuantity?.system?.absoluteString, "http://unitsofmeasure.org") - XCTAssertEqual(inst.component?[1].valueQuantity?.unit, "mmHg") - XCTAssertEqual(inst.component?[1].valueQuantity?.value, NSDecimalNumber(string: "60")) + XCTAssertEqual(inst.component?[1].dataAbsentReason?.coding?[0].code, "not-performed") + XCTAssertEqual(inst.component?[1].dataAbsentReason?.coding?[0].display, "Not Performed") + XCTAssertEqual(inst.component?[1].dataAbsentReason?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/data-absent-reason") XCTAssertEqual(inst.effectiveDateTime?.description, "2012-09-17") - XCTAssertEqual(inst.id, "blood-pressure") + XCTAssertEqual(inst.id, "blood-pressure-dar") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:ietf:rfc:3986") XCTAssertEqual(inst.identifier?[0].value, "urn:uuid:187e0c12-8dd2-67e2-99b2-bf273c878281") XCTAssertEqual(inst.interpretation?.coding?[0].code, "L") XCTAssertEqual(inst.interpretation?.coding?[0].display, "low") XCTAssertEqual(inst.interpretation?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v2/0078") XCTAssertEqual(inst.interpretation?.text, "Below low normal") - XCTAssertEqual(inst.meta?.lastUpdated?.description, "2014-01-30T22:35:23+11:00") XCTAssertEqual(inst.performer?[0].reference, "Practitioner/example") - XCTAssertEqual(inst.status, "final") + XCTAssertEqual(inst.status, ObservationStatus(rawValue: "final")!) XCTAssertEqual(inst.subject?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -677,25 +675,49 @@ class ObservationTests: XCTestCase { @discardableResult func runObservation8(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Observation { - let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "observation-example-bmd.json") + let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "observation-example-bloodpressure.json") - XCTAssertEqual(inst.bodySite?.coding?[0].code, "71341001:272741003=7771000") + XCTAssertEqual(inst.bodySite?.coding?[0].code, "368209003") + XCTAssertEqual(inst.bodySite?.coding?[0].display, "Right arm") XCTAssertEqual(inst.bodySite?.coding?[0].system?.absoluteString, "http://snomed.info/sct") - XCTAssertEqual(inst.bodySite?.text, "Left Femur") - XCTAssertEqual(inst.code?.coding?[0].code, "24701-5") - XCTAssertEqual(inst.code?.coding?[0].display, "Femur DXA Bone density") + XCTAssertEqual(inst.category?[0].coding?[0].code, "vital-signs") + XCTAssertEqual(inst.category?[0].coding?[0].display, "Vital Signs") + XCTAssertEqual(inst.category?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/observation-category") + XCTAssertEqual(inst.code?.coding?[0].code, "55284-4") + XCTAssertEqual(inst.code?.coding?[0].display, "Blood pressure systolic & diastolic") XCTAssertEqual(inst.code?.coding?[0].system?.absoluteString, "http://loinc.org") - XCTAssertEqual(inst.code?.text, "BMD - Left Femur") - XCTAssertEqual(inst.id, "bmd") - XCTAssertEqual(inst.performer?[0].display, "Acme Imaging Diagnostics") - XCTAssertEqual(inst.performer?[0].reference, "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f") - XCTAssertEqual(inst.status, "final") - XCTAssertEqual(inst.subject?.reference, "Patient/pat2") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.valueQuantity?.code, "g/cm-2") - XCTAssertEqual(inst.valueQuantity?.system?.absoluteString, "http://unitsofmeasure.org") - XCTAssertEqual(inst.valueQuantity?.unit, "g/cm²") - XCTAssertEqual(inst.valueQuantity?.value, NSDecimalNumber(string: "0.887")) + XCTAssertEqual(inst.component?[0].code?.coding?[0].code, "8480-6") + XCTAssertEqual(inst.component?[0].code?.coding?[0].display, "Systolic blood pressure") + XCTAssertEqual(inst.component?[0].code?.coding?[0].system?.absoluteString, "http://loinc.org") + XCTAssertEqual(inst.component?[0].code?.coding?[1].code, "271649006") + XCTAssertEqual(inst.component?[0].code?.coding?[1].display, "Systolic blood pressure") + XCTAssertEqual(inst.component?[0].code?.coding?[1].system?.absoluteString, "http://snomed.info/sct") + XCTAssertEqual(inst.component?[0].code?.coding?[2].code, "bp-s") + XCTAssertEqual(inst.component?[0].code?.coding?[2].display, "Systolic Blood pressure") + XCTAssertEqual(inst.component?[0].code?.coding?[2].system?.absoluteString, "http://acme.org/devices/clinical-codes") + XCTAssertEqual(inst.component?[0].valueQuantity?.code, "mm[Hg]") + XCTAssertEqual(inst.component?[0].valueQuantity?.system?.absoluteString, "http://unitsofmeasure.org") + XCTAssertEqual(inst.component?[0].valueQuantity?.unit, "mmHg") + XCTAssertEqual(inst.component?[0].valueQuantity?.value, NSDecimalNumber(string: "107")) + XCTAssertEqual(inst.component?[1].code?.coding?[0].code, "8462-4") + XCTAssertEqual(inst.component?[1].code?.coding?[0].display, "Diastolic blood pressure") + XCTAssertEqual(inst.component?[1].code?.coding?[0].system?.absoluteString, "http://loinc.org") + XCTAssertEqual(inst.component?[1].valueQuantity?.code, "mm[Hg]") + XCTAssertEqual(inst.component?[1].valueQuantity?.system?.absoluteString, "http://unitsofmeasure.org") + XCTAssertEqual(inst.component?[1].valueQuantity?.unit, "mmHg") + XCTAssertEqual(inst.component?[1].valueQuantity?.value, NSDecimalNumber(string: "60")) + XCTAssertEqual(inst.effectiveDateTime?.description, "2012-09-17") + XCTAssertEqual(inst.id, "blood-pressure") + XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:ietf:rfc:3986") + XCTAssertEqual(inst.identifier?[0].value, "urn:uuid:187e0c12-8dd2-67e2-99b2-bf273c878281") + XCTAssertEqual(inst.interpretation?.coding?[0].code, "L") + XCTAssertEqual(inst.interpretation?.coding?[0].display, "low") + XCTAssertEqual(inst.interpretation?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v2/0078") + XCTAssertEqual(inst.interpretation?.text, "Below low normal") + XCTAssertEqual(inst.performer?[0].reference, "Practitioner/example") + XCTAssertEqual(inst.status, ObservationStatus(rawValue: "final")!) + XCTAssertEqual(inst.subject?.reference, "Patient/example") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -712,15 +734,25 @@ class ObservationTests: XCTestCase { @discardableResult func runObservation9(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Observation { - let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "observation-example-eye-color.json") + let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "observation-example-bmd.json") - XCTAssertEqual(inst.code?.text, "eye color") - XCTAssertEqual(inst.effectiveDateTime?.description, "2016-05-18") - XCTAssertEqual(inst.id, "eye-color") - XCTAssertEqual(inst.status, "final") - XCTAssertEqual(inst.subject?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.valueString, "blue") + XCTAssertEqual(inst.bodySite?.coding?[0].code, "71341001:272741003=7771000") + XCTAssertEqual(inst.bodySite?.coding?[0].system?.absoluteString, "http://snomed.info/sct") + XCTAssertEqual(inst.bodySite?.text, "Left Femur") + XCTAssertEqual(inst.code?.coding?[0].code, "24701-5") + XCTAssertEqual(inst.code?.coding?[0].display, "Femur DXA Bone density") + XCTAssertEqual(inst.code?.coding?[0].system?.absoluteString, "http://loinc.org") + XCTAssertEqual(inst.code?.text, "BMD - Left Femur") + XCTAssertEqual(inst.id, "bmd") + XCTAssertEqual(inst.performer?[0].display, "Acme Imaging Diagnostics") + XCTAssertEqual(inst.performer?[0].reference, "Organization/1832473e-2fe0-452d-abe9-3cdb9879522f") + XCTAssertEqual(inst.status, ObservationStatus(rawValue: "final")!) + XCTAssertEqual(inst.subject?.reference, "Patient/pat2") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.valueQuantity?.code, "g/cm-2") + XCTAssertEqual(inst.valueQuantity?.system?.absoluteString, "http://unitsofmeasure.org") + XCTAssertEqual(inst.valueQuantity?.unit, "g/cm²") + XCTAssertEqual(inst.valueQuantity?.value, NSDecimalNumber(string: "0.887")) return inst } @@ -737,38 +769,25 @@ class ObservationTests: XCTestCase { @discardableResult func runObservation10(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.Observation { - let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "observation-example-f001-glucose.json") + let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "observation-example-bmi.json") - XCTAssertEqual(inst.code?.coding?[0].code, "15074-8") - XCTAssertEqual(inst.code?.coding?[0].display, "Glucose [Moles/volume] in Blood") + XCTAssertEqual(inst.category?[0].coding?[0].code, "vital-signs") + XCTAssertEqual(inst.category?[0].coding?[0].display, "Vital Signs") + XCTAssertEqual(inst.category?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/observation-category") + XCTAssertEqual(inst.category?[0].text, "Vital Signs") + XCTAssertEqual(inst.code?.coding?[0].code, "39156-5") + XCTAssertEqual(inst.code?.coding?[0].display, "Body mass index (BMI) [Ratio]") XCTAssertEqual(inst.code?.coding?[0].system?.absoluteString, "http://loinc.org") - XCTAssertEqual(inst.effectivePeriod?.start?.description, "2013-04-02T09:30:10+01:00") - XCTAssertEqual(inst.id, "f001") - XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://www.bmc.nl/zorgportal/identifiers/observations") - XCTAssertEqual(inst.identifier?[0].use, "official") - XCTAssertEqual(inst.identifier?[0].value, "6323") - XCTAssertEqual(inst.interpretation?.coding?[0].code, "H") - XCTAssertEqual(inst.interpretation?.coding?[0].display, "High") - XCTAssertEqual(inst.interpretation?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v2/0078") - XCTAssertEqual(inst.issued?.description, "2013-04-03T15:30:10+01:00") - XCTAssertEqual(inst.performer?[0].display, "A. Langeveld") - XCTAssertEqual(inst.performer?[0].reference, "Practitioner/f005") - XCTAssertEqual(inst.referenceRange?[0].high?.code, "mmol/L") - XCTAssertEqual(inst.referenceRange?[0].high?.system?.absoluteString, "http://unitsofmeasure.org") - XCTAssertEqual(inst.referenceRange?[0].high?.unit, "mmol/l") - XCTAssertEqual(inst.referenceRange?[0].high?.value, NSDecimalNumber(string: "6.2")) - XCTAssertEqual(inst.referenceRange?[0].low?.code, "mmol/L") - XCTAssertEqual(inst.referenceRange?[0].low?.system?.absoluteString, "http://unitsofmeasure.org") - XCTAssertEqual(inst.referenceRange?[0].low?.unit, "mmol/l") - XCTAssertEqual(inst.referenceRange?[0].low?.value, NSDecimalNumber(string: "3.1")) - XCTAssertEqual(inst.status, "final") - XCTAssertEqual(inst.subject?.display, "P. van de Heuvel") - XCTAssertEqual(inst.subject?.reference, "Patient/f001") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.valueQuantity?.code, "mmol/L") + XCTAssertEqual(inst.code?.text, "BMI") + XCTAssertEqual(inst.effectiveDateTime?.description, "1999-07-02") + XCTAssertEqual(inst.id, "bmi") + XCTAssertEqual(inst.status, ObservationStatus(rawValue: "final")!) + XCTAssertEqual(inst.subject?.reference, "Patient/example") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.valueQuantity?.code, "kg/m2") XCTAssertEqual(inst.valueQuantity?.system?.absoluteString, "http://unitsofmeasure.org") - XCTAssertEqual(inst.valueQuantity?.unit, "mmol/l") - XCTAssertEqual(inst.valueQuantity?.value, NSDecimalNumber(string: "6.3")) + XCTAssertEqual(inst.valueQuantity?.unit, "kg/m2") + XCTAssertEqual(inst.valueQuantity?.value, NSDecimalNumber(string: "16.2")) return inst } diff --git a/Tests/ModelTests/OperationDefinitionTests.swift b/Tests/ModelTests/OperationDefinitionTests.swift index 0a31832b..caa8eead 100644 --- a/Tests/ModelTests/OperationDefinitionTests.swift +++ b/Tests/ModelTests/OperationDefinitionTests.swift @@ -2,7 +2,7 @@ // OperationDefinitionTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -38,30 +38,30 @@ class OperationDefinitionTests: XCTestCase { XCTAssertEqual(inst.code, "populate") XCTAssertEqual(inst.comment, "Only implemented for Labs and Medications so far") XCTAssertEqual(inst.contact?[0].name, "System Administrator") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "email") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "email")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "beep@coyote.acme.com") XCTAssertEqual(inst.date?.description, "2015-08-04") XCTAssertEqual(inst.description_fhir, "Limited implementation of the Populate Questionnaire implemenation") XCTAssertEqual(inst.id, "example") XCTAssertTrue(inst.instance ?? false) - XCTAssertEqual(inst.kind, "operation") + XCTAssertEqual(inst.kind, OperationKind(rawValue: "operation")!) XCTAssertEqual(inst.name, "Populate Questionnaire") XCTAssertEqual(inst.parameter?[0].max, "1") XCTAssertEqual(inst.parameter?[0].min, 1) XCTAssertEqual(inst.parameter?[0].name, "subject") XCTAssertEqual(inst.parameter?[0].type, "Reference") - XCTAssertEqual(inst.parameter?[0].use, "in") + XCTAssertEqual(inst.parameter?[0].use, OperationParameterUse(rawValue: "in")!) XCTAssertEqual(inst.parameter?[1].documentation, "The partially (or fully)-populated set of answers for the specified Questionnaire") XCTAssertEqual(inst.parameter?[1].max, "1") XCTAssertEqual(inst.parameter?[1].min, 1) XCTAssertEqual(inst.parameter?[1].name, "return") XCTAssertEqual(inst.parameter?[1].type, "QuestionnaireResponse") - XCTAssertEqual(inst.parameter?[1].use, "out") + XCTAssertEqual(inst.parameter?[1].use, OperationParameterUse(rawValue: "out")!) XCTAssertEqual(inst.publisher, "Acme Healthcare Services") XCTAssertEqual(inst.resource?[0], "Questionnaire") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) XCTAssertFalse(inst.system ?? true) - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertFalse(inst.type ?? true) XCTAssertEqual(inst.url?.absoluteString, "http://h7.org/fhir/OperationDefinition/example") XCTAssertEqual(inst.version, "B") diff --git a/Tests/ModelTests/OperationOutcomeTests.swift b/Tests/ModelTests/OperationOutcomeTests.swift index fa13b068..e27feb3b 100644 --- a/Tests/ModelTests/OperationOutcomeTests.swift +++ b/Tests/ModelTests/OperationOutcomeTests.swift @@ -2,7 +2,7 @@ // OperationOutcomeTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -35,10 +35,10 @@ class OperationOutcomeTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "operationoutcome-example-allok.json") XCTAssertEqual(inst.id, "allok") - XCTAssertEqual(inst.issue?[0].code, "informational") + XCTAssertEqual(inst.issue?[0].code, IssueType(rawValue: "informational")!) XCTAssertEqual(inst.issue?[0].details?.text, "All OK") - XCTAssertEqual(inst.issue?[0].severity, "information") - XCTAssertEqual(inst.text?.status, "additional") + XCTAssertEqual(inst.issue?[0].severity, IssueSeverity(rawValue: "information")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "additional")!) return inst } @@ -58,13 +58,13 @@ class OperationOutcomeTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "operationoutcome-example-break-the-glass.json") XCTAssertEqual(inst.id, "break-the-glass") - XCTAssertEqual(inst.issue?[0].code, "suppressed") + XCTAssertEqual(inst.issue?[0].code, IssueType(rawValue: "suppressed")!) XCTAssertEqual(inst.issue?[0].details?.coding?[0].code, "ETREAT") XCTAssertEqual(inst.issue?[0].details?.coding?[0].display, "Emergency Treatment") XCTAssertEqual(inst.issue?[0].details?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3-ActReason") XCTAssertEqual(inst.issue?[0].details?.text, "Additional information may be available using the Break-The-Glass Protocol") - XCTAssertEqual(inst.issue?[0].severity, "information") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.issue?[0].severity, IssueSeverity(rawValue: "information")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -84,10 +84,10 @@ class OperationOutcomeTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "operationoutcome-example-exception.json") XCTAssertEqual(inst.id, "exception") - XCTAssertEqual(inst.issue?[0].code, "exception") + XCTAssertEqual(inst.issue?[0].code, IssueType(rawValue: "exception")!) XCTAssertEqual(inst.issue?[0].details?.text, "SQL Link Communication Error (dbx = 34234)") - XCTAssertEqual(inst.issue?[0].severity, "error") - XCTAssertEqual(inst.text?.status, "additional") + XCTAssertEqual(inst.issue?[0].severity, IssueSeverity(rawValue: "error")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "additional")!) return inst } @@ -107,11 +107,11 @@ class OperationOutcomeTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "operationoutcome-example-searchfail.json") XCTAssertEqual(inst.id, "searchfail") - XCTAssertEqual(inst.issue?[0].code, "code-invalid") + XCTAssertEqual(inst.issue?[0].code, IssueType(rawValue: "code-invalid")!) XCTAssertEqual(inst.issue?[0].details?.text, "The \"name\" parameter has the modifier \"exact\" which is not supported by this server") XCTAssertEqual(inst.issue?[0].location?[0], "http.name:exact") - XCTAssertEqual(inst.issue?[0].severity, "fatal") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.issue?[0].severity, IssueSeverity(rawValue: "fatal")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -131,11 +131,11 @@ class OperationOutcomeTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "operationoutcome-example-validationfail.json") XCTAssertEqual(inst.id, "validationfail") - XCTAssertEqual(inst.issue?[0].code, "structure") + XCTAssertEqual(inst.issue?[0].code, IssueType(rawValue: "structure")!) XCTAssertEqual(inst.issue?[0].details?.text, "Error parsing resource XML (Unknown Content \"label\"") XCTAssertEqual(inst.issue?[0].location?[0], "/f:Patient/f:identifier") - XCTAssertEqual(inst.issue?[0].severity, "error") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.issue?[0].severity, IssueSeverity(rawValue: "error")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -155,12 +155,12 @@ class OperationOutcomeTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "operationoutcome-example.json") XCTAssertEqual(inst.id, "101") - XCTAssertEqual(inst.issue?[0].code, "code-invalid") + XCTAssertEqual(inst.issue?[0].code, IssueType(rawValue: "code-invalid")!) XCTAssertEqual(inst.issue?[0].details?.text, "The code \"W\" is not known and not legal in this context") XCTAssertEqual(inst.issue?[0].diagnostics, "Acme.Interop.FHIRProcessors.Patient.processGender line 2453") XCTAssertEqual(inst.issue?[0].location?[0], "/f:Person/f:gender") - XCTAssertEqual(inst.issue?[0].severity, "error") - XCTAssertEqual(inst.text?.status, "additional") + XCTAssertEqual(inst.issue?[0].severity, IssueSeverity(rawValue: "error")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "additional")!) return inst } diff --git a/Tests/ModelTests/OrganizationTests.swift b/Tests/ModelTests/OrganizationTests.swift index 92864898..c08287ec 100644 --- a/Tests/ModelTests/OrganizationTests.swift +++ b/Tests/ModelTests/OrganizationTests.swift @@ -2,7 +2,7 @@ // OrganizationTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -38,32 +38,32 @@ class OrganizationTests: XCTestCase { XCTAssertEqual(inst.address?[0].country, "NLD") XCTAssertEqual(inst.address?[0].line?[0], "Galapagosweg 91") XCTAssertEqual(inst.address?[0].postalCode, "9105 PZ") - XCTAssertEqual(inst.address?[0].use, "work") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "work")!) XCTAssertEqual(inst.address?[1].city, "Den Burg") XCTAssertEqual(inst.address?[1].country, "NLD") XCTAssertEqual(inst.address?[1].line?[0], "PO Box 2311") XCTAssertEqual(inst.address?[1].postalCode, "9100 AA") - XCTAssertEqual(inst.address?[1].use, "work") + XCTAssertEqual(inst.address?[1].use, AddressUse(rawValue: "work")!) XCTAssertEqual(inst.contact?[0].purpose?.coding?[0].code, "PRESS") XCTAssertEqual(inst.contact?[0].purpose?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/contactentity-type") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "phone") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "phone")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "022-655 2334") XCTAssertEqual(inst.contact?[1].purpose?.coding?[0].code, "PATINF") XCTAssertEqual(inst.contact?[1].purpose?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/contactentity-type") - XCTAssertEqual(inst.contact?[1].telecom?[0].system, "phone") + XCTAssertEqual(inst.contact?[1].telecom?[0].system, ContactPointSystem(rawValue: "phone")!) XCTAssertEqual(inst.contact?[1].telecom?[0].value, "022-655 2335") XCTAssertEqual(inst.id, "f001") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.528.1") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "91654") XCTAssertEqual(inst.identifier?[1].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.6.1") - XCTAssertEqual(inst.identifier?[1].use, "usual") + XCTAssertEqual(inst.identifier?[1].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[1].value, "17-0112278") XCTAssertEqual(inst.name, "Burgers University Medical Center") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "022-655 2300") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "V6") XCTAssertEqual(inst.type?.coding?[0].display, "University Medical Hospital") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.15.1060") @@ -94,18 +94,18 @@ class OrganizationTests: XCTestCase { XCTAssertEqual(inst.contact?[0].name?.text, "mevr. D. de Haan") XCTAssertEqual(inst.contact?[0].purpose?.coding?[0].code, "ADMIN") XCTAssertEqual(inst.contact?[0].purpose?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/contactentity-type") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "phone") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "phone")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "022-655 2321") - XCTAssertEqual(inst.contact?[0].telecom?[1].system, "email") + XCTAssertEqual(inst.contact?[0].telecom?[1].system, ContactPointSystem(rawValue: "email")!) XCTAssertEqual(inst.contact?[0].telecom?[1].value, "cardio@burgersumc.nl") - XCTAssertEqual(inst.contact?[0].telecom?[2].system, "fax") + XCTAssertEqual(inst.contact?[0].telecom?[2].system, ContactPointSystem(rawValue: "fax")!) XCTAssertEqual(inst.contact?[0].telecom?[2].value, "022-655 2322") XCTAssertEqual(inst.id, "f002") XCTAssertEqual(inst.name, "Burgers UMC Cardiology unit") XCTAssertEqual(inst.partOf?.reference, "Organization/f001") - XCTAssertEqual(inst.telecom?[0].system, "phone") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) XCTAssertEqual(inst.telecom?[0].value, "022-655 2320") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "dept") XCTAssertEqual(inst.type?.coding?[0].display, "Hospital Department") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/organization-type") @@ -133,18 +133,18 @@ class OrganizationTests: XCTestCase { XCTAssertEqual(inst.contact?[0].name?.text, "mr. F. de Hond") XCTAssertEqual(inst.contact?[0].purpose?.coding?[0].code, "ADMIN") XCTAssertEqual(inst.contact?[0].purpose?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/contactentity-type") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "phone") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "phone")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "022-655 7654") - XCTAssertEqual(inst.contact?[0].telecom?[1].system, "email") + XCTAssertEqual(inst.contact?[0].telecom?[1].system, ContactPointSystem(rawValue: "email")!) XCTAssertEqual(inst.contact?[0].telecom?[1].value, "KNO@burgersumc.nl") - XCTAssertEqual(inst.contact?[0].telecom?[2].system, "fax") + XCTAssertEqual(inst.contact?[0].telecom?[2].system, ContactPointSystem(rawValue: "fax")!) XCTAssertEqual(inst.contact?[0].telecom?[2].value, "022-655 0998") XCTAssertEqual(inst.id, "f003") XCTAssertEqual(inst.name, "Burgers UMC Ear,Nose,Throat unit") XCTAssertEqual(inst.partOf?.reference, "Organization/f001") - XCTAssertEqual(inst.telecom?[0].system, "phone") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) XCTAssertEqual(inst.telecom?[0].value, "022-655 6780") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "dept") XCTAssertEqual(inst.type?.coding?[0].display, "Hospital Department") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/organization-type") @@ -171,7 +171,7 @@ class OrganizationTests: XCTestCase { XCTAssertEqual(inst.address?[0].country, "NLD") XCTAssertEqual(inst.address?[0].line?[0], "Walvisbaai 3") XCTAssertEqual(inst.address?[0].postalCode, "2333ZA") - XCTAssertEqual(inst.address?[0].use, "work") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "work")!) XCTAssertEqual(inst.contact?[0].address?.city, "Den helder") XCTAssertEqual(inst.contact?[0].address?.country, "NLD") XCTAssertEqual(inst.contact?[0].address?.line?[0], "Walvisbaai 3") @@ -181,19 +181,19 @@ class OrganizationTests: XCTestCase { XCTAssertEqual(inst.contact?[0].name?.given?[0], "Ronald") XCTAssertEqual(inst.contact?[0].name?.prefix?[0], "Prof.Dr.") XCTAssertEqual(inst.contact?[0].name?.text, "Professor Brand") - XCTAssertEqual(inst.contact?[0].name?.use, "official") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "phone") - XCTAssertEqual(inst.contact?[0].telecom?[0].use, "work") + XCTAssertEqual(inst.contact?[0].name?.use, NameUse(rawValue: "official")!) + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.contact?[0].telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "+31715269702") XCTAssertEqual(inst.id, "f201") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://www.zorgkaartnederland.nl/") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "Artis University Medical Center") XCTAssertEqual(inst.name, "Artis University Medical Center (AUMC)") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "+31715269111") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "405608006") XCTAssertEqual(inst.type?.coding?[0].display, "Academic Medical Center") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -226,17 +226,17 @@ class OrganizationTests: XCTestCase { XCTAssertEqual(inst.address?[0].country, "NLD") XCTAssertEqual(inst.address?[0].line?[0], "apenrots 230") XCTAssertEqual(inst.address?[0].postalCode, "3056BE") - XCTAssertEqual(inst.address?[0].use, "work") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "work")!) XCTAssertEqual(inst.id, "f203") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://www.zorgkaartnederland.nl/") XCTAssertEqual(inst.identifier?[0].type?.text, "Zorginstelling naam") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "Blijdorp MC") XCTAssertEqual(inst.name, "Blijdorp Medisch Centrum (BUMC)") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "+31107040704") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "405608006") XCTAssertEqual(inst.type?.coding?[0].display, "Academic Medical Center") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -266,13 +266,13 @@ class OrganizationTests: XCTestCase { XCTAssertEqual(inst.name, "Gastroenterology") XCTAssertEqual(inst.partOf?.display, "ACME Healthcare, Inc") XCTAssertEqual(inst.partOf?.reference, "Organization/1") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "mobile") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "mobile")!) XCTAssertEqual(inst.telecom?[0].value, "+1 555 234 3523") - XCTAssertEqual(inst.telecom?[1].system, "email") - XCTAssertEqual(inst.telecom?[1].use, "work") + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.telecom?[1].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[1].value, "gastro@acme.org") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -295,7 +295,7 @@ class OrganizationTests: XCTestCase { XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:ietf:rfc:3986") XCTAssertEqual(inst.identifier?[0].value, "2.16.840.1.113883.19.5") XCTAssertEqual(inst.name, "Good Health Clinic") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -319,7 +319,7 @@ class OrganizationTests: XCTestCase { XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.3.19.2.3") XCTAssertEqual(inst.identifier?[0].value, "666666") XCTAssertEqual(inst.name, "XYZ Insurance") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -342,13 +342,13 @@ class OrganizationTests: XCTestCase { XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://www.acme.org.au/units") XCTAssertEqual(inst.identifier?[0].value, "ClinLab") XCTAssertEqual(inst.name, "Clinical Lab") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "+1 555 234 1234") - XCTAssertEqual(inst.telecom?[1].system, "email") - XCTAssertEqual(inst.telecom?[1].use, "work") + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.telecom?[1].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[1].value, "contact@labs.acme.org") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -371,7 +371,7 @@ class OrganizationTests: XCTestCase { XCTAssertEqual(inst.address?[0].country, "Swizterland") XCTAssertEqual(inst.id, "mmanu") XCTAssertEqual(inst.name, "Acme Corporation") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/ParametersTests.swift b/Tests/ModelTests/ParametersTests.swift index f33049c5..49723121 100644 --- a/Tests/ModelTests/ParametersTests.swift +++ b/Tests/ModelTests/ParametersTests.swift @@ -2,7 +2,7 @@ // ParametersTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // diff --git a/Tests/ModelTests/PatientTests.swift b/Tests/ModelTests/PatientTests.swift index 663c8499..d36922ae 100644 --- a/Tests/ModelTests/PatientTests.swift +++ b/Tests/ModelTests/PatientTests.swift @@ -2,7 +2,7 @@ // PatientTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -39,22 +39,22 @@ class PatientTests: XCTestCase { XCTAssertEqual(inst.contact?[0].organization?.reference, "Organization/1") XCTAssertEqual(inst.contact?[0].relationship?[0].coding?[0].code, "owner") XCTAssertEqual(inst.contact?[0].relationship?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/patient-contact-relationship") - XCTAssertEqual(inst.gender, "male") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "male")!) XCTAssertEqual(inst.id, "pat1") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:0.1.2.3.4.5.6.7") XCTAssertEqual(inst.identifier?[0].type?.coding?[0].code, "MR") XCTAssertEqual(inst.identifier?[0].type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v2/0203") - XCTAssertEqual(inst.identifier?[0].use, "usual") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[0].value, "654321") XCTAssertEqual(inst.link?[0].other?.reference, "Patient/pat2") - XCTAssertEqual(inst.link?[0].type, "seealso") + XCTAssertEqual(inst.link?[0].type, LinkType(rawValue: "seealso")!) XCTAssertEqual(inst.managingOrganization?.display, "ACME Healthcare, Inc") XCTAssertEqual(inst.managingOrganization?.reference, "Organization/1") XCTAssertEqual(inst.name?[0].family?[0], "Donald") XCTAssertEqual(inst.name?[0].given?[0], "Duck") - XCTAssertEqual(inst.name?[0].use, "official") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) XCTAssertEqual(inst.photo?[0].contentType, "image/gif") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -91,10 +91,10 @@ class PatientTests: XCTestCase { XCTAssertEqual(inst.contact?[0].name?.given?[1], "James") XCTAssertEqual(inst.contact?[0].relationship?[0].coding?[0].code, "owner") XCTAssertEqual(inst.contact?[0].relationship?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/patient-contact-relationship") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "phone") - XCTAssertEqual(inst.contact?[0].telecom?[0].use, "work") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.contact?[0].telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "(03) 5555 6473") - XCTAssertEqual(inst.gender, "female") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "female")!) XCTAssertEqual(inst.id, "animal") XCTAssertEqual(inst.identifier?[0].assigner?.display, "Maroondah City Council") XCTAssertEqual(inst.identifier?[0].period?.start?.description, "2010-05-31") @@ -103,8 +103,8 @@ class PatientTests: XCTestCase { XCTAssertEqual(inst.identifier?[0].value, "1234123") XCTAssertEqual(inst.managingOrganization?.display, "Pete's Vetinary Services") XCTAssertEqual(inst.name?[0].given?[0], "Kenzi") - XCTAssertEqual(inst.name?[0].use, "usual") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "usual")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -124,23 +124,23 @@ class PatientTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "patient-example-b.json") XCTAssertTrue(inst.active ?? false) - XCTAssertEqual(inst.gender, "other") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "other")!) XCTAssertEqual(inst.id, "pat2") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:0.1.2.3.4.5.6.7") XCTAssertEqual(inst.identifier?[0].type?.coding?[0].code, "MR") XCTAssertEqual(inst.identifier?[0].type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v2/0203") - XCTAssertEqual(inst.identifier?[0].use, "usual") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[0].value, "123456") XCTAssertEqual(inst.link?[0].other?.reference, "Patient/pat1") - XCTAssertEqual(inst.link?[0].type, "seealso") + XCTAssertEqual(inst.link?[0].type, LinkType(rawValue: "seealso")!) XCTAssertEqual(inst.managingOrganization?.display, "ACME Healthcare, Inc") XCTAssertEqual(inst.managingOrganization?.reference, "Organization/1") XCTAssertEqual(inst.name?[0].family?[0], "Donald") XCTAssertEqual(inst.name?[0].given?[0], "Duck") XCTAssertEqual(inst.name?[0].given?[1], "D") - XCTAssertEqual(inst.name?[0].use, "official") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) XCTAssertEqual(inst.photo?[0].contentType, "image/gif") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -162,19 +162,19 @@ class PatientTests: XCTestCase { XCTAssertTrue(inst.active ?? false) XCTAssertEqual(inst.birthDate?.description, "1982-01-23") XCTAssertEqual(inst.deceasedDateTime?.description, "2015-02-14T13:42:00+10:00") - XCTAssertEqual(inst.gender, "male") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "male")!) XCTAssertEqual(inst.id, "pat3") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:0.1.2.3.4.5.6.7") XCTAssertEqual(inst.identifier?[0].type?.coding?[0].code, "MR") XCTAssertEqual(inst.identifier?[0].type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v2/0203") - XCTAssertEqual(inst.identifier?[0].use, "usual") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[0].value, "123457") XCTAssertEqual(inst.managingOrganization?.display, "ACME Healthcare, Inc") XCTAssertEqual(inst.managingOrganization?.reference, "Organization/1") XCTAssertEqual(inst.name?[0].family?[0], "Notsowell") XCTAssertEqual(inst.name?[0].given?[0], "Simon") - XCTAssertEqual(inst.name?[0].use, "official") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -196,19 +196,19 @@ class PatientTests: XCTestCase { XCTAssertTrue(inst.active ?? false) XCTAssertEqual(inst.birthDate?.description, "1982-08-02") XCTAssertTrue(inst.deceasedBoolean ?? false) - XCTAssertEqual(inst.gender, "female") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "female")!) XCTAssertEqual(inst.id, "pat4") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:0.1.2.3.4.5.6.7") XCTAssertEqual(inst.identifier?[0].type?.coding?[0].code, "MR") XCTAssertEqual(inst.identifier?[0].type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v2/0203") - XCTAssertEqual(inst.identifier?[0].use, "usual") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[0].value, "123458") XCTAssertEqual(inst.managingOrganization?.display, "ACME Healthcare, Inc") XCTAssertEqual(inst.managingOrganization?.reference, "Organization/1") XCTAssertEqual(inst.name?[0].family?[0], "Notsowell") XCTAssertEqual(inst.name?[0].given?[0], "Sandy") - XCTAssertEqual(inst.name?[0].use, "official") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -237,13 +237,13 @@ class PatientTests: XCTestCase { XCTAssertEqual(inst.extension_fhir?[2].url?.absoluteString, "http://nema.org/fhir/extensions#0010:1030") XCTAssertEqual(inst.extension_fhir?[2].valueQuantity?.unit, "kg") XCTAssertEqual(inst.extension_fhir?[2].valueQuantity?.value, NSDecimalNumber(string: "72.58")) - XCTAssertEqual(inst.gender, "male") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "male")!) XCTAssertEqual(inst.id, "dicom") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://nema.org/examples/patients") XCTAssertEqual(inst.identifier?[0].value, "MINT1234") XCTAssertEqual(inst.managingOrganization?.reference, "Organization/1") XCTAssertEqual(inst.name?[0].family?[0], "MINT_TEST") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -267,7 +267,7 @@ class PatientTests: XCTestCase { XCTAssertEqual(inst.address?[0].country, "NLD") XCTAssertEqual(inst.address?[0].line?[0], "Van Egmondkade 23") XCTAssertEqual(inst.address?[0].postalCode, "1024 RJ") - XCTAssertEqual(inst.address?[0].use, "home") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "home")!) XCTAssertEqual(inst.birthDate?.description, "1944-11-17") XCTAssertEqual(inst.communication?[0].language?.coding?[0].code, "nl") XCTAssertEqual(inst.communication?[0].language?.coding?[0].display, "Dutch") @@ -276,20 +276,20 @@ class PatientTests: XCTestCase { XCTAssertTrue(inst.communication?[0].preferred ?? false) XCTAssertEqual(inst.contact?[0].name?.family?[0], "Abels") XCTAssertEqual(inst.contact?[0].name?.given?[0], "Sarah") - XCTAssertEqual(inst.contact?[0].name?.use, "usual") + XCTAssertEqual(inst.contact?[0].name?.use, NameUse(rawValue: "usual")!) XCTAssertEqual(inst.contact?[0].relationship?[0].coding?[0].code, "partner") XCTAssertEqual(inst.contact?[0].relationship?[0].coding?[0].system?.absoluteString, "http://hl7.org/fhir/patient-contact-relationship") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "phone") - XCTAssertEqual(inst.contact?[0].telecom?[0].use, "mobile") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.contact?[0].telecom?[0].use, ContactPointUse(rawValue: "mobile")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "0690383372") XCTAssertFalse(inst.deceasedBoolean ?? true) - XCTAssertEqual(inst.gender, "male") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "male")!) XCTAssertEqual(inst.id, "f001") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.6.3") - XCTAssertEqual(inst.identifier?[0].use, "usual") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[0].value, "738472983") XCTAssertEqual(inst.identifier?[1].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.6.3") - XCTAssertEqual(inst.identifier?[1].use, "usual") + XCTAssertEqual(inst.identifier?[1].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.managingOrganization?.display, "Burgers University Medical Centre") XCTAssertEqual(inst.managingOrganization?.reference, "Organization/f001") XCTAssertEqual(inst.maritalStatus?.coding?[0].code, "M") @@ -300,14 +300,14 @@ class PatientTests: XCTestCase { XCTAssertEqual(inst.name?[0].family?[0], "van de Heuvel") XCTAssertEqual(inst.name?[0].given?[0], "Pieter") XCTAssertEqual(inst.name?[0].suffix?[0], "MSc") - XCTAssertEqual(inst.name?[0].use, "usual") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "mobile") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "usual")!) + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "mobile")!) XCTAssertEqual(inst.telecom?[0].value, "0648352638") - XCTAssertEqual(inst.telecom?[1].system, "email") - XCTAssertEqual(inst.telecom?[1].use, "home") + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.telecom?[1].use, ContactPointUse(rawValue: "home")!) XCTAssertEqual(inst.telecom?[1].value, "p.heuvel@gmail.com") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -331,32 +331,32 @@ class PatientTests: XCTestCase { XCTAssertEqual(inst.address?[0].country, "NLD") XCTAssertEqual(inst.address?[0].line?[0], "Bos en Lommerplein 280") XCTAssertEqual(inst.address?[0].postalCode, "1055RW") - XCTAssertEqual(inst.address?[0].use, "home") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "home")!) XCTAssertEqual(inst.birthDate?.description, "1960-03-13") XCTAssertEqual(inst.communication?[0].language?.coding?[0].code, "nl-NL") XCTAssertEqual(inst.communication?[0].language?.coding?[0].display, "Dutch") XCTAssertEqual(inst.communication?[0].language?.coding?[0].system?.absoluteString, "urn:ietf:bcp:47") XCTAssertTrue(inst.communication?[0].preferred ?? false) XCTAssertEqual(inst.contact?[0].name?.text, "Ariadne Bor-Jansma") - XCTAssertEqual(inst.contact?[0].name?.use, "usual") + XCTAssertEqual(inst.contact?[0].name?.use, NameUse(rawValue: "usual")!) XCTAssertEqual(inst.contact?[0].relationship?[0].coding?[0].code, "127850001") XCTAssertEqual(inst.contact?[0].relationship?[0].coding?[0].display, "Wife") XCTAssertEqual(inst.contact?[0].relationship?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.contact?[0].relationship?[0].coding?[1].code, "partner") XCTAssertEqual(inst.contact?[0].relationship?[0].coding?[1].system?.absoluteString, "http://hl7.org/fhir/patient-contact-relationship") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "phone") - XCTAssertEqual(inst.contact?[0].telecom?[0].use, "home") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.contact?[0].telecom?[0].use, ContactPointUse(rawValue: "home")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "+31201234567") XCTAssertFalse(inst.deceasedBoolean ?? true) - XCTAssertEqual(inst.gender, "male") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "male")!) XCTAssertEqual(inst.id, "f201") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.6.3") XCTAssertEqual(inst.identifier?[0].type?.text, "BSN") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "123456789") XCTAssertEqual(inst.identifier?[1].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.6.3") XCTAssertEqual(inst.identifier?[1].type?.text, "BSN") - XCTAssertEqual(inst.identifier?[1].use, "official") + XCTAssertEqual(inst.identifier?[1].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[1].value, "123456789") XCTAssertEqual(inst.managingOrganization?.display, "AUMC") XCTAssertEqual(inst.managingOrganization?.reference, "Organization/f201") @@ -371,16 +371,16 @@ class PatientTests: XCTestCase { XCTAssertEqual(inst.name?[0].prefix?[0], "Drs.") XCTAssertEqual(inst.name?[0].suffix?[0], "PDEng.") XCTAssertEqual(inst.name?[0].text, "Roel") - XCTAssertEqual(inst.name?[0].use, "official") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) XCTAssertEqual(inst.photo?[0].contentType, "image/jpeg") XCTAssertEqual(inst.photo?[0].url?.absoluteString, "Binary/f006") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "mobile") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "mobile")!) XCTAssertEqual(inst.telecom?[0].value, "+31612345678") - XCTAssertEqual(inst.telecom?[1].system, "phone") - XCTAssertEqual(inst.telecom?[1].use, "home") + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[1].use, ContactPointUse(rawValue: "home")!) XCTAssertEqual(inst.telecom?[1].value, "+31201234567") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -406,7 +406,7 @@ class PatientTests: XCTestCase { XCTAssertEqual(inst.name?[0].family?[0], "BROOKS") XCTAssertEqual(inst.name?[0].given?[0], "ALBERT") XCTAssertEqual(inst.text?.div, "
Albert Brooks, Id: AB60001
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -433,14 +433,14 @@ class PatientTests: XCTestCase { XCTAssertEqual(inst.extension_fhir?[0].extension_fhir?[0].valueCoding?.display, "White") XCTAssertEqual(inst.extension_fhir?[0].extension_fhir?[0].valueCoding?.system?.absoluteString, "http://hl7.org/fhir/v3/Race") XCTAssertEqual(inst.extension_fhir?[0].url?.absoluteString, "http://hl7.org/fhir/StructureDefinition/us-core-race") - XCTAssertEqual(inst.gender, "female") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "female")!) XCTAssertEqual(inst.id, "proband") XCTAssertEqual(inst.identifier?[0].assigner?.display, "Boston Massachesetts General Hospital") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.6.117") XCTAssertEqual(inst.identifier?[0].type?.text, "Computer-Stored Abulatory Records (COSTAR)") - XCTAssertEqual(inst.identifier?[0].use, "usual") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[0].value, "999999999") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/PaymentNoticeTests.swift b/Tests/ModelTests/PaymentNoticeTests.swift index a77e338b..46ecfb4a 100644 --- a/Tests/ModelTests/PaymentNoticeTests.swift +++ b/Tests/ModelTests/PaymentNoticeTests.swift @@ -2,7 +2,7 @@ // PaymentNoticeTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -42,9 +42,9 @@ class PaymentNoticeTests: XCTestCase { XCTAssertEqual(inst.paymentStatus?.code, "paid") XCTAssertEqual(inst.paymentStatus?.system?.absoluteString, "http://hl7.org/fhir/paymentstatus") XCTAssertEqual(inst.request?.reference, "http://benefitsinc.com/fhir/claim/12345") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, PaymentNoticeStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the PaymentNotice
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/PaymentReconciliationTests.swift b/Tests/ModelTests/PaymentReconciliationTests.swift index 9c3aef46..8b8addd4 100644 --- a/Tests/ModelTests/PaymentReconciliationTests.swift +++ b/Tests/ModelTests/PaymentReconciliationTests.swift @@ -2,7 +2,7 @@ // PaymentReconciliationTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -63,9 +63,9 @@ class PaymentReconciliationTests: XCTestCase { XCTAssertEqual(inst.outcome, "complete") XCTAssertEqual(inst.request?.reference, "http://www.BenefitsInc.com/fhir/eligibility/225476332402") XCTAssertEqual(inst.requestOrganization?.reference, "Organization/1") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, PaymentReconciliationStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the PaymentReconciliation
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.total?.code, "USD") XCTAssertEqual(inst.total?.system?.absoluteString, "urn:iso:std:iso:4217") XCTAssertEqual(inst.total?.value, NSDecimalNumber(string: "3500.0")) diff --git a/Tests/ModelTests/PersonTests.swift b/Tests/ModelTests/PersonTests.swift index 895c6d14..68777eba 100644 --- a/Tests/ModelTests/PersonTests.swift +++ b/Tests/ModelTests/PersonTests.swift @@ -2,7 +2,7 @@ // PersonTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -36,17 +36,17 @@ class PersonTests: XCTestCase { XCTAssertTrue(inst.active ?? false) XCTAssertEqual(inst.birthDate?.description, "1963") - XCTAssertEqual(inst.gender, "female") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "female")!) XCTAssertEqual(inst.id, "f002") XCTAssertEqual(inst.link?[0].target?.display, "Ariadne Bor-Jansma") XCTAssertEqual(inst.link?[0].target?.reference, "RelatedPerson/f002") XCTAssertEqual(inst.name?[0].text, "Ariadne Bor-Jansma") - XCTAssertEqual(inst.name?[0].use, "usual") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "usual")!) XCTAssertEqual(inst.photo?.contentType, "image/jpeg") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "home") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "home")!) XCTAssertEqual(inst.telecom?[0].value, "+31201234567") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -70,16 +70,16 @@ class PersonTests: XCTestCase { XCTAssertEqual(inst.address?[0].line?[0], "534 Erewhon St") XCTAssertEqual(inst.address?[0].postalCode, "3999") XCTAssertEqual(inst.address?[0].state, "Vic") - XCTAssertEqual(inst.address?[0].use, "home") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "home")!) XCTAssertEqual(inst.birthDate?.description, "1974-12-25") - XCTAssertEqual(inst.gender, "male") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "male")!) XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.identifier?[0].assigner?.display, "Acme Healthcare") XCTAssertEqual(inst.identifier?[0].period?.start?.description, "2001-05-06") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:1.2.36.146.595.217.0.1") XCTAssertEqual(inst.identifier?[0].type?.coding?[0].code, "MR") XCTAssertEqual(inst.identifier?[0].type?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v2/0203") - XCTAssertEqual(inst.identifier?[0].use, "usual") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[0].value, "12345") XCTAssertEqual(inst.link?[0].target?.display, "Peter Chalmers") XCTAssertEqual(inst.link?[0].target?.reference, "RelatedPerson/peter") @@ -88,17 +88,17 @@ class PersonTests: XCTestCase { XCTAssertEqual(inst.name?[0].family?[0], "Chalmers") XCTAssertEqual(inst.name?[0].given?[0], "Peter") XCTAssertEqual(inst.name?[0].given?[1], "James") - XCTAssertEqual(inst.name?[0].use, "official") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) XCTAssertEqual(inst.name?[1].given?[0], "Jim") - XCTAssertEqual(inst.name?[1].use, "usual") - XCTAssertEqual(inst.telecom?[0].use, "home") - XCTAssertEqual(inst.telecom?[1].system, "phone") - XCTAssertEqual(inst.telecom?[1].use, "work") + XCTAssertEqual(inst.name?[1].use, NameUse(rawValue: "usual")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "home")!) + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[1].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[1].value, "(03) 5555 6473") - XCTAssertEqual(inst.telecom?[2].system, "email") - XCTAssertEqual(inst.telecom?[2].use, "home") + XCTAssertEqual(inst.telecom?[2].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.telecom?[2].use, ContactPointUse(rawValue: "home")!) XCTAssertEqual(inst.telecom?[2].value, "Jim@example.org") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/PlanDefinitionTests.swift b/Tests/ModelTests/PlanDefinitionTests.swift index 0cab3c8c..22df9da0 100644 --- a/Tests/ModelTests/PlanDefinitionTests.swift +++ b/Tests/ModelTests/PlanDefinitionTests.swift @@ -2,7 +2,7 @@ // PlanDefinitionTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -40,17 +40,19 @@ class PlanDefinitionTests: XCTestCase { XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].actionDefinition?[1].textEquivalent, "CARBOplatin AUC 5 IV over 30 minutes on Day 1") XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].actionIdentifier?.system?.absoluteString, "http://nccn.org/ordertemplates/KDN5") XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].actionIdentifier?.value, "cycle-definition-1") - XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].cardinalityBehavior, "multiple") XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].textEquivalent, "21-day cycle for 6 cycles") XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].timingTiming?.repeat_fhir?.count, 6) XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].timingTiming?.repeat_fhir?.duration, NSDecimalNumber(string: "21")) XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].timingTiming?.repeat_fhir?.durationUnit, "d") - XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].groupingBehavior, "sentence-group") + XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].groupingBehavior, PlanActionGroupingBehavior(rawValue: "sentence-group")!) + XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].selectionBehavior, PlanActionSelectionBehavior(rawValue: "exactly-one")!) + XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].selectionBehavior, PlanActionSelectionBehavior(rawValue: "all")!) + XCTAssertEqual(inst.actionDefinition?[0].selectionBehavior, PlanActionSelectionBehavior(rawValue: "exactly-one")!) XCTAssertEqual(inst.approvalDate?.description, "2016-07-27") XCTAssertEqual(inst.contained?[0].id, "1111") XCTAssertEqual(inst.contained?[1].id, "2222") XCTAssertEqual(inst.contributor?[0].name, "Lee Surprenant") - XCTAssertEqual(inst.contributor?[0].type, "author") + XCTAssertEqual(inst.contributor?[0].type, ContributorType(rawValue: "author")!) XCTAssertEqual(inst.copyright, "All rights reserved.") XCTAssertTrue(inst.experimental ?? false) XCTAssertEqual(inst.id, "KDN5") @@ -59,15 +61,45 @@ class PlanDefinitionTests: XCTestCase { XCTAssertEqual(inst.lastReviewDate?.description, "2016-07-27") XCTAssertEqual(inst.publisher, "National Comprehensive Cancer Network, Inc.") XCTAssertEqual(inst.relatedArtifact?[0].display, "NCCN Guidelines for Kidney Cancer. V.2.2016") - XCTAssertEqual(inst.relatedArtifact?[0].type, "derived-from") + XCTAssertEqual(inst.relatedArtifact?[0].type, RelatedArtifactType(rawValue: "derived-from")!) XCTAssertEqual(inst.relatedArtifact?[0].url?.absoluteString, "http://www.nccn.org/professionals/physician_gls/PDF/kidney.pdf") XCTAssertEqual(inst.relatedArtifact?[1].citation, "Oudard S, et al. J Urol. 2007;177(5):1698-702") - XCTAssertEqual(inst.relatedArtifact?[1].type, "citation") + XCTAssertEqual(inst.relatedArtifact?[1].type, RelatedArtifactType(rawValue: "citation")!) XCTAssertEqual(inst.relatedArtifact?[1].url?.absoluteString, "http://www.ncbi.nlm.nih.gov/pubmed/17437788") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.text?.status, "additional") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "additional")!) XCTAssertEqual(inst.title, "Gemcitabine/CARBOplatin") XCTAssertEqual(inst.type?.text, "Chemotherapy Order Template") + XCTAssertEqual(inst.useContext?[0].code?.code, "treamentSetting-or-diseaseStatus") + XCTAssertEqual(inst.useContext?[0].code?.system?.absoluteString, "http://nccn.org/fhir/CodeSystem/indications") + XCTAssertEqual(inst.useContext?[0].extension_fhir?[0].url?.absoluteString, "http://hl7.org/fhir/StructureDefinition/usagecontext-group") + XCTAssertEqual(inst.useContext?[0].extension_fhir?[0].valueString, "A") + XCTAssertEqual(inst.useContext?[0].valueCodeableConcept?.text, "Metastatic") + XCTAssertEqual(inst.useContext?[1].code?.code, "disease-or-histology") + XCTAssertEqual(inst.useContext?[1].code?.system?.absoluteString, "http://nccn.org/fhir/CodeSystem/indications") + XCTAssertEqual(inst.useContext?[1].extension_fhir?[0].url?.absoluteString, "http://hl7.org/fhir/StructureDefinition/usagecontext-group") + XCTAssertEqual(inst.useContext?[1].extension_fhir?[0].valueString, "A") + XCTAssertEqual(inst.useContext?[1].valueCodeableConcept?.text, "Collecting Duct/Medullary Subtypes") + XCTAssertEqual(inst.useContext?[2].code?.code, "focus") + XCTAssertEqual(inst.useContext?[2].code?.system?.absoluteString, "http://hl7.org/fhir/usage-context-type") + XCTAssertEqual(inst.useContext?[2].extension_fhir?[0].url?.absoluteString, "http://hl7.org/fhir/StructureDefinition/usagecontext-group") + XCTAssertEqual(inst.useContext?[2].extension_fhir?[0].valueString, "A") + XCTAssertEqual(inst.useContext?[2].valueCodeableConcept?.text, "Kidney Cancer") + XCTAssertEqual(inst.useContext?[3].code?.code, "treatmentSetting-or-diseaseStatus") + XCTAssertEqual(inst.useContext?[3].code?.system?.absoluteString, "http://nccn.org/fhir/CodeSystem/indications") + XCTAssertEqual(inst.useContext?[3].extension_fhir?[0].url?.absoluteString, "http://hl7.org/fhir/StructureDefinition/usagecontext-group") + XCTAssertEqual(inst.useContext?[3].extension_fhir?[0].valueString, "B") + XCTAssertEqual(inst.useContext?[3].valueCodeableConcept?.text, "Relapsed") + XCTAssertEqual(inst.useContext?[4].code?.code, "disease-or-histology") + XCTAssertEqual(inst.useContext?[4].code?.system?.absoluteString, "http://nccn.org/fhir/CodeSystem/indications") + XCTAssertEqual(inst.useContext?[4].extension_fhir?[0].url?.absoluteString, "http://hl7.org/fhir/StructureDefinition/usagecontext-group") + XCTAssertEqual(inst.useContext?[4].extension_fhir?[0].valueString, "B") + XCTAssertEqual(inst.useContext?[4].valueCodeableConcept?.text, "Collecting Duct/Medullary Subtypes") + XCTAssertEqual(inst.useContext?[5].code?.code, "focus") + XCTAssertEqual(inst.useContext?[5].code?.system?.absoluteString, "http://hl7.org/fhir/usage-context-type") + XCTAssertEqual(inst.useContext?[5].extension_fhir?[0].url?.absoluteString, "http://hl7.org/fhir/StructureDefinition/usagecontext-group") + XCTAssertEqual(inst.useContext?[5].extension_fhir?[0].valueString, "B") + XCTAssertEqual(inst.useContext?[5].valueCodeableConcept?.text, "Kidney Cancer – Collecting Duct/Medullary Subtypes - Metastatic") XCTAssertEqual(inst.version, "1") return inst @@ -103,8 +135,8 @@ class PlanDefinitionTests: XCTestCase { XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].dynamicValue?[6].expression, "RiskAssessment") XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].dynamicValue?[6].path, "supportingInformation") XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].textEquivalent, "Refer to outpatient mental health program for evaluation and treatment of mental health conditions now") - XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].groupingBehavior, "logical-group") - XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].selectionBehavior, "any") + XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].groupingBehavior, PlanActionGroupingBehavior(rawValue: "logical-group")!) + XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].selectionBehavior, PlanActionSelectionBehavior(rawValue: "any")!) XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[0].title, "Consults and Referrals") XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].activityDefinition?.reference, "#citalopramPrescription") XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].actionDefinition?[0].actionDefinition?[0].dynamicValue?[0].expression, "'draft'") @@ -125,9 +157,9 @@ class PlanDefinitionTests: XCTestCase { XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].actionDefinition?[0].documentation?[0].document?.contentType, "text/html") XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].actionDefinition?[0].documentation?[0].document?.title, "National Library of Medicine. DailyMed website. CITALOPRAM- citalopram hydrobromide tablet, film coated.") XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].actionDefinition?[0].documentation?[0].document?.url?.absoluteString, "http://dailymed.nlm.nih.gov/dailymed/drugInfo.cfm?setid=6daeb45c-451d-b135-bf8f-2d6dff4b6b01") - XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].actionDefinition?[0].documentation?[0].type, "justification") - XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].actionDefinition?[0].groupingBehavior, "logical-group") - XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].actionDefinition?[0].selectionBehavior, "at-most-one") + XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].actionDefinition?[0].documentation?[0].type, RelatedArtifactType(rawValue: "justification")!) + XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].actionDefinition?[0].groupingBehavior, PlanActionGroupingBehavior(rawValue: "logical-group")!) + XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].actionDefinition?[0].selectionBehavior, PlanActionSelectionBehavior(rawValue: "at-most-one")!) XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].actionDefinition?[0].title, "Selective Serotonin Reuptake Inhibitors (Choose a mazimum of one or document reasons for exception)") XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].actionDefinition?[1].textEquivalent, "Dopamine Norepinephrine Reuptake Inhibitors (Choose a maximum of one or document reasons for exception)") XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].actionDefinition?[2].textEquivalent, "Serotonin Norepinephrine Reuptake Inhibitors (Choose a maximum of one or doument reasons for exception)") @@ -135,42 +167,42 @@ class PlanDefinitionTests: XCTestCase { XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].documentation?[0].document?.contentType, "text/html") XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].documentation?[0].document?.title, "Practice Guideline for the Treatment of Patients with Major Depressive Disorder") XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].documentation?[0].document?.url?.absoluteString, "http://psychiatryonline.org/pb/assets/raw/sitewide/practice_guidelines/guidelines/mdd.pdf") - XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].documentation?[0].type, "justification") - XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].groupingBehavior, "logical-group") - XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].selectionBehavior, "at-most-one") + XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].documentation?[0].type, RelatedArtifactType(rawValue: "justification")!) + XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].groupingBehavior, PlanActionGroupingBehavior(rawValue: "logical-group")!) + XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].selectionBehavior, PlanActionSelectionBehavior(rawValue: "at-most-one")!) XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].actionDefinition?[0].title, "First-Line Antidepressants") - XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].groupingBehavior, "logical-group") - XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].selectionBehavior, "at-most-one") + XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].groupingBehavior, PlanActionGroupingBehavior(rawValue: "logical-group")!) + XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].selectionBehavior, PlanActionSelectionBehavior(rawValue: "at-most-one")!) XCTAssertEqual(inst.actionDefinition?[0].actionDefinition?[1].title, "Medications") XCTAssertEqual(inst.actionDefinition?[0].title, "Suicide Risk Assessment and Outpatient Management") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "phone") - XCTAssertEqual(inst.contact?[0].telecom?[0].use, "work") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.contact?[0].telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "415-362-4007") - XCTAssertEqual(inst.contact?[0].telecom?[1].system, "email") - XCTAssertEqual(inst.contact?[0].telecom?[1].use, "work") + XCTAssertEqual(inst.contact?[0].telecom?[1].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.contact?[0].telecom?[1].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.contact?[0].telecom?[1].value, "info@motivemi.com") XCTAssertEqual(inst.contained?[0].id, "referralToMentalHealthCare") XCTAssertEqual(inst.contained?[1].id, "citalopramPrescription") XCTAssertEqual(inst.contained?[2].id, "citalopramMedication") XCTAssertEqual(inst.contained?[3].id, "citalopramSubstance") - XCTAssertEqual(inst.contributor?[0].contact?[0].telecom?[0].system, "phone") - XCTAssertEqual(inst.contributor?[0].contact?[0].telecom?[0].use, "work") + XCTAssertEqual(inst.contributor?[0].contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.contributor?[0].contact?[0].telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.contributor?[0].contact?[0].telecom?[0].value, "415-362-4007") - XCTAssertEqual(inst.contributor?[0].contact?[0].telecom?[1].system, "email") - XCTAssertEqual(inst.contributor?[0].contact?[0].telecom?[1].use, "work") + XCTAssertEqual(inst.contributor?[0].contact?[0].telecom?[1].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.contributor?[0].contact?[0].telecom?[1].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.contributor?[0].contact?[0].telecom?[1].value, "info@motivemi.com") XCTAssertEqual(inst.contributor?[0].name, "Motive Medical Intelligence") - XCTAssertEqual(inst.contributor?[0].type, "author") + XCTAssertEqual(inst.contributor?[0].type, ContributorType(rawValue: "author")!) XCTAssertEqual(inst.date?.description, "2015-08-15") XCTAssertEqual(inst.description_fhir, "...") XCTAssertEqual(inst.id, "example") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "mmi:low-suicide-risk-order-set") XCTAssertEqual(inst.library?[0].reference, "Library/mmi-suiciderisk-orderset-logic") XCTAssertEqual(inst.publisher, "Motive Medical Intelligence") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) XCTAssertEqual(inst.text?.div, "
Low Suicide Risk Order Set...
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.title, "Low Suicide Risk Order Set") XCTAssertEqual(inst.topic?[0].text, "Suicide risk assessment") XCTAssertEqual(inst.useContext?[0].code?.code, "gender") @@ -233,13 +265,13 @@ class PlanDefinitionTests: XCTestCase { XCTAssertEqual(inst.actionDefinition?[0].title, "Measure, Weight, Height, Waist, Circumference; Calculate BMI") XCTAssertEqual(inst.contained?[0].id, "procedure") XCTAssertEqual(inst.contributor?[0].name, "National Heart, Lung, and Blood Institute http://www.nhlbi.nih.gov/health-pro/guidelines/current/obesity-guidelines/e_textbook/txgd/algorthm/algorthm.htm") - XCTAssertEqual(inst.contributor?[0].type, "author") + XCTAssertEqual(inst.contributor?[0].type, ContributorType(rawValue: "author")!) XCTAssertEqual(inst.id, "protocol-example") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://acme.org") XCTAssertEqual(inst.identifier?[0].value, "example-1") XCTAssertEqual(inst.purpose, "Example of A medical algorithm for assessment and treatment of overweight and obesity") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.title, "Obesity Assessment Protocol") XCTAssertEqual(inst.type?.coding?[0].code, "protocol") diff --git a/Tests/ModelTests/PractitionerRoleTests.swift b/Tests/ModelTests/PractitionerRoleTests.swift index 217245e3..d18e9512 100644 --- a/Tests/ModelTests/PractitionerRoleTests.swift +++ b/Tests/ModelTests/PractitionerRoleTests.swift @@ -2,7 +2,7 @@ // PractitionerRoleTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -47,10 +47,10 @@ class PractitionerRoleTests: XCTestCase { XCTAssertEqual(inst.organization?.reference, "Organization/f001") XCTAssertEqual(inst.period?.end?.description, "2012-03-31") XCTAssertEqual(inst.period?.start?.description, "2012-01-01") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "home") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "home")!) XCTAssertEqual(inst.telecom?[0].value, "(03) 5555 6473") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/PractitionerTests.swift b/Tests/ModelTests/PractitionerTests.swift index 50299433..7283fd99 100644 --- a/Tests/ModelTests/PractitionerTests.swift +++ b/Tests/ModelTests/PractitionerTests.swift @@ -2,7 +2,7 @@ // PractitionerTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -38,20 +38,20 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.address?[0].country, "NLD") XCTAssertEqual(inst.address?[0].line?[0], "Galapagosweg 91") XCTAssertEqual(inst.address?[0].postalCode, "9105 PZ") - XCTAssertEqual(inst.address?[0].use, "work") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "work")!) XCTAssertEqual(inst.birthDate?.description, "1975-12-07") - XCTAssertEqual(inst.gender, "male") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "male")!) XCTAssertEqual(inst.id, "f001") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.528.1.1007.3.1") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "938273695") XCTAssertEqual(inst.identifier?[1].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.6.3") - XCTAssertEqual(inst.identifier?[1].use, "usual") + XCTAssertEqual(inst.identifier?[1].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[1].value, "129IDH4OP733") XCTAssertEqual(inst.name?[0].family?[0], "van den broek") XCTAssertEqual(inst.name?[0].given?[0], "Eric") XCTAssertEqual(inst.name?[0].suffix?[0], "MD") - XCTAssertEqual(inst.name?[0].use, "official") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) XCTAssertEqual(inst.role?[0].code?.coding?[0].code, "01.000") XCTAssertEqual(inst.role?[0].code?.coding?[0].display, "Arts") XCTAssertEqual(inst.role?[0].code?.coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.15.111") @@ -62,16 +62,16 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].display, "Ear-, Nose and Throat") XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.15.111") XCTAssertEqual(inst.role?[0].specialty?[0].text, "specialization") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "0205568263") - XCTAssertEqual(inst.telecom?[1].system, "email") - XCTAssertEqual(inst.telecom?[1].use, "work") + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.telecom?[1].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[1].value, "E.M.vandenbroek@bmc.nl") - XCTAssertEqual(inst.telecom?[2].system, "fax") - XCTAssertEqual(inst.telecom?[2].use, "work") + XCTAssertEqual(inst.telecom?[2].system, ContactPointSystem(rawValue: "fax")!) + XCTAssertEqual(inst.telecom?[2].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[2].value, "0205664440") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -94,20 +94,20 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.address?[0].country, "NLD") XCTAssertEqual(inst.address?[0].line?[0], "Galapagosweg 91") XCTAssertEqual(inst.address?[0].postalCode, "9105 PZ") - XCTAssertEqual(inst.address?[0].use, "work") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "work")!) XCTAssertEqual(inst.birthDate?.description, "1979-04-29") - XCTAssertEqual(inst.gender, "male") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "male")!) XCTAssertEqual(inst.id, "f002") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.528.1.1007.3.1") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "730291637") XCTAssertEqual(inst.identifier?[1].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.6.3") - XCTAssertEqual(inst.identifier?[1].use, "usual") + XCTAssertEqual(inst.identifier?[1].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[1].value, "174BIP3JH438") XCTAssertEqual(inst.name?[0].family?[0], "Voigt") XCTAssertEqual(inst.name?[0].given?[0], "Pieter") XCTAssertEqual(inst.name?[0].suffix?[0], "MD") - XCTAssertEqual(inst.name?[0].use, "official") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) XCTAssertEqual(inst.role?[0].code?.coding?[0].code, "01.000") XCTAssertEqual(inst.role?[0].code?.coding?[0].display, "Arts") XCTAssertEqual(inst.role?[0].code?.coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.15.111") @@ -118,16 +118,16 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].display, "Cardiothoracal surgery") XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.15.111") XCTAssertEqual(inst.role?[0].specialty?[0].text, "specialization") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "0205569336") - XCTAssertEqual(inst.telecom?[1].system, "email") - XCTAssertEqual(inst.telecom?[1].use, "work") + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.telecom?[1].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[1].value, "p.voigt@bmc.nl") - XCTAssertEqual(inst.telecom?[2].system, "fax") - XCTAssertEqual(inst.telecom?[2].use, "work") + XCTAssertEqual(inst.telecom?[2].system, ContactPointSystem(rawValue: "fax")!) + XCTAssertEqual(inst.telecom?[2].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[2].value, "0205669382") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -150,23 +150,23 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.address?[0].country, "NLD") XCTAssertEqual(inst.address?[0].line?[0], "Galapagosweg 91") XCTAssertEqual(inst.address?[0].postalCode, "1105 AZ") - XCTAssertEqual(inst.address?[0].use, "work") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "work")!) XCTAssertEqual(inst.birthDate?.description, "1963-07-01") XCTAssertEqual(inst.communication?[0].coding?[0].code, "nl") XCTAssertEqual(inst.communication?[0].coding?[0].display, "Dutch") XCTAssertEqual(inst.communication?[0].coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.6.121") - XCTAssertEqual(inst.gender, "male") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "male")!) XCTAssertEqual(inst.id, "f003") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.528.1.1007.3.1") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "846100293") XCTAssertEqual(inst.identifier?[1].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.6.3") - XCTAssertEqual(inst.identifier?[1].use, "usual") + XCTAssertEqual(inst.identifier?[1].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[1].value, "243HID3RT938") XCTAssertEqual(inst.name?[0].family?[0], "Versteegh") XCTAssertEqual(inst.name?[0].given?[0], "Marc") XCTAssertEqual(inst.name?[0].suffix?[0], "MD") - XCTAssertEqual(inst.name?[0].use, "official") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) XCTAssertEqual(inst.role?[0].code?.coding?[0].code, "01.000") XCTAssertEqual(inst.role?[0].code?.coding?[0].display, "Arts") XCTAssertEqual(inst.role?[0].code?.coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.15.111") @@ -177,16 +177,16 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].display, "Cardiothoracal surgery") XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.15.111") XCTAssertEqual(inst.role?[0].specialty?[0].text, "specialization") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "0205562431") - XCTAssertEqual(inst.telecom?[1].system, "email") - XCTAssertEqual(inst.telecom?[1].use, "work") + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.telecom?[1].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[1].value, "m.versteegh@bmc.nl") - XCTAssertEqual(inst.telecom?[2].system, "fax") - XCTAssertEqual(inst.telecom?[2].use, "work") + XCTAssertEqual(inst.telecom?[2].system, ContactPointSystem(rawValue: "fax")!) + XCTAssertEqual(inst.telecom?[2].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[2].value, "0205662948") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -209,24 +209,24 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.address?[0].country, "NLD") XCTAssertEqual(inst.address?[0].line?[0], "Galapagosweg 91") XCTAssertEqual(inst.address?[0].postalCode, "1105 AZ") - XCTAssertEqual(inst.address?[0].use, "work") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "work")!) XCTAssertEqual(inst.birthDate?.description, "1980-02-04") XCTAssertEqual(inst.communication?[0].coding?[0].code, "nl") XCTAssertEqual(inst.communication?[0].coding?[0].display, "Netherlands") XCTAssertEqual(inst.communication?[0].coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.6.121") XCTAssertEqual(inst.communication?[0].text, "Language") - XCTAssertEqual(inst.gender, "male") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "male")!) XCTAssertEqual(inst.id, "f004") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.528.1.1007.3.1") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "118265112") XCTAssertEqual(inst.identifier?[1].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.6.3") - XCTAssertEqual(inst.identifier?[1].use, "usual") + XCTAssertEqual(inst.identifier?[1].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[1].value, "523ASA1LK927") XCTAssertEqual(inst.name?[0].family?[0], "Briet") XCTAssertEqual(inst.name?[0].given?[0], "Ronald") XCTAssertEqual(inst.name?[0].suffix?[0], "MD") - XCTAssertEqual(inst.name?[0].use, "official") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) XCTAssertEqual(inst.role?[0].code?.coding?[0].code, "01.000") XCTAssertEqual(inst.role?[0].code?.coding?[0].display, "Arts") XCTAssertEqual(inst.role?[0].code?.coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.15.111") @@ -237,16 +237,16 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].display, "Ear-, Nose and Throat") XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.15.111") XCTAssertEqual(inst.role?[0].specialty?[0].text, "specialization") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "0205569273") - XCTAssertEqual(inst.telecom?[1].system, "email") - XCTAssertEqual(inst.telecom?[1].use, "work") + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.telecom?[1].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[1].value, "r.briet@bmc.nl") - XCTAssertEqual(inst.telecom?[2].system, "fax") - XCTAssertEqual(inst.telecom?[2].use, "work") + XCTAssertEqual(inst.telecom?[2].system, ContactPointSystem(rawValue: "fax")!) + XCTAssertEqual(inst.telecom?[2].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[2].value, "0205664440") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -269,23 +269,23 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.address?[0].country, "NLD") XCTAssertEqual(inst.address?[0].line?[0], "Galapagosweg 9") XCTAssertEqual(inst.address?[0].postalCode, "1105 AZ") - XCTAssertEqual(inst.address?[0].use, "work") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "work")!) XCTAssertEqual(inst.birthDate?.description, "1959-03-11") XCTAssertEqual(inst.communication?[0].coding?[0].code, "fr") XCTAssertEqual(inst.communication?[0].coding?[0].display, "France") XCTAssertEqual(inst.communication?[0].coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.6.121") - XCTAssertEqual(inst.gender, "female") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "female")!) XCTAssertEqual(inst.id, "f005") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.528.1.1007.3.1") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "118265112") XCTAssertEqual(inst.identifier?[1].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.6.3") - XCTAssertEqual(inst.identifier?[1].use, "usual") + XCTAssertEqual(inst.identifier?[1].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[1].value, "191REW8WE916") XCTAssertEqual(inst.name?[0].family?[0], "Anne") XCTAssertEqual(inst.name?[0].given?[0], "Langeveld") XCTAssertEqual(inst.name?[0].suffix?[0], "MD") - XCTAssertEqual(inst.name?[0].use, "official") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) XCTAssertEqual(inst.photo?[0].contentType, "image/jpeg") XCTAssertEqual(inst.role?[0].code?.coding?[0].code, "01.000") XCTAssertEqual(inst.role?[0].code?.coding?[0].display, "Arts") @@ -297,16 +297,16 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].display, "Keel- neus- en oorarts") XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.15.111") XCTAssertEqual(inst.role?[0].specialty?[0].text, "specialization") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "0205563847") - XCTAssertEqual(inst.telecom?[1].system, "email") - XCTAssertEqual(inst.telecom?[1].use, "work") + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.telecom?[1].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[1].value, "a.langeveld@bmc.nl") - XCTAssertEqual(inst.telecom?[2].system, "fax") - XCTAssertEqual(inst.telecom?[2].use, "work") + XCTAssertEqual(inst.telecom?[2].system, ContactPointSystem(rawValue: "fax")!) + XCTAssertEqual(inst.telecom?[2].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[2].value, "0205668916") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -329,20 +329,20 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.address?[0].country, "NLD") XCTAssertEqual(inst.address?[0].line?[0], "Galapagosweg 91") XCTAssertEqual(inst.address?[0].postalCode, "9105 PZ") - XCTAssertEqual(inst.address?[0].use, "work") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "work")!) XCTAssertEqual(inst.birthDate?.description, "1975-12-07") - XCTAssertEqual(inst.gender, "male") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "male")!) XCTAssertEqual(inst.id, "f006") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.528.1.1007.3.1") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "937223645") XCTAssertEqual(inst.identifier?[1].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.6.3") - XCTAssertEqual(inst.identifier?[1].use, "usual") + XCTAssertEqual(inst.identifier?[1].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[1].value, "134IDY41W988") XCTAssertEqual(inst.name?[0].family?[0], "van den Berk") XCTAssertEqual(inst.name?[0].given?[0], "Rob") XCTAssertEqual(inst.name?[0].suffix?[0], "MD") - XCTAssertEqual(inst.name?[0].use, "official") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) XCTAssertEqual(inst.role?[0].code?.coding?[0].code, "01.000") XCTAssertEqual(inst.role?[0].code?.coding?[0].display, "Arts") XCTAssertEqual(inst.role?[0].code?.coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.15.111") @@ -353,16 +353,16 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].display, "Pharmacist") XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.15.111") XCTAssertEqual(inst.role?[0].specialty?[0].text, "specialization") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "0205569288") - XCTAssertEqual(inst.telecom?[1].system, "email") - XCTAssertEqual(inst.telecom?[1].use, "work") + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.telecom?[1].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[1].value, "R.A.vandenberk@bmc.nl") - XCTAssertEqual(inst.telecom?[2].system, "fax") - XCTAssertEqual(inst.telecom?[2].use, "work") + XCTAssertEqual(inst.telecom?[2].system, ContactPointSystem(rawValue: "fax")!) + XCTAssertEqual(inst.telecom?[2].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[2].value, "0205664987") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -385,20 +385,20 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.address?[0].country, "NLD") XCTAssertEqual(inst.address?[0].line?[0], "Galapagosweg 91") XCTAssertEqual(inst.address?[0].postalCode, "9105 PZ") - XCTAssertEqual(inst.address?[0].use, "work") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "work")!) XCTAssertEqual(inst.birthDate?.description, "1971-11-07") - XCTAssertEqual(inst.gender, "female") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "female")!) XCTAssertEqual(inst.id, "f007") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.528.1.1007.3.1") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "874635264") XCTAssertEqual(inst.identifier?[1].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.6.3") - XCTAssertEqual(inst.identifier?[1].use, "usual") + XCTAssertEqual(inst.identifier?[1].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[1].value, "567IUI51C154") XCTAssertEqual(inst.name?[0].family?[0], "Heps") XCTAssertEqual(inst.name?[0].given?[0], "Simone") XCTAssertEqual(inst.name?[0].suffix?[0], "MD") - XCTAssertEqual(inst.name?[0].use, "official") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) XCTAssertEqual(inst.role?[0].code?.coding?[0].code, "01.000") XCTAssertEqual(inst.role?[0].code?.coding?[0].display, "Arts") XCTAssertEqual(inst.role?[0].code?.coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.15.111") @@ -409,16 +409,16 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].display, "Physician") XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.15.111") XCTAssertEqual(inst.role?[0].specialty?[0].text, "specialization") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "020556936") - XCTAssertEqual(inst.telecom?[1].system, "email") - XCTAssertEqual(inst.telecom?[1].use, "work") + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.telecom?[1].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[1].value, "S.M.Heps@bmc.nl") - XCTAssertEqual(inst.telecom?[2].system, "fax") - XCTAssertEqual(inst.telecom?[2].use, "work") + XCTAssertEqual(inst.telecom?[2].system, ContactPointSystem(rawValue: "fax")!) + XCTAssertEqual(inst.telecom?[2].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[2].value, "0205669283") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -443,19 +443,19 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.address?[0].line?[0], "Walvisbaai 3") XCTAssertEqual(inst.address?[0].line?[1], "C4 - Automatisering") XCTAssertEqual(inst.address?[0].postalCode, "2333ZA") - XCTAssertEqual(inst.address?[0].use, "work") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "work")!) XCTAssertEqual(inst.birthDate?.description, "1956-12-24") - XCTAssertEqual(inst.gender, "male") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "male")!) XCTAssertEqual(inst.id, "f201") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.528.1.1007.3.1") XCTAssertEqual(inst.identifier?[0].type?.text, "UZI-nummer") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "12345678901") XCTAssertEqual(inst.name?[0].family?[0], "Bronsig") XCTAssertEqual(inst.name?[0].given?[0], "Arend") XCTAssertEqual(inst.name?[0].prefix?[0], "Dr.") XCTAssertEqual(inst.name?[0].text, "Dokter Bronsig") - XCTAssertEqual(inst.name?[0].use, "official") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) XCTAssertEqual(inst.qualification?[0].code?.coding?[0].code, "41672002") XCTAssertEqual(inst.qualification?[0].code?.coding?[0].display, "Pulmonologist") XCTAssertEqual(inst.qualification?[0].code?.coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -467,10 +467,10 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].code, "310512001") XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].display, "Medical oncologist") XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "+31715269111") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -495,23 +495,23 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.address?[0].line?[0], "Walvisbaai 3") XCTAssertEqual(inst.address?[0].line?[1], "C4 - Automatisering") XCTAssertEqual(inst.address?[0].postalCode, "2333ZA") - XCTAssertEqual(inst.address?[0].use, "work") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "work")!) XCTAssertEqual(inst.birthDate?.description, "1960-06-12") - XCTAssertEqual(inst.gender, "male") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "male")!) XCTAssertEqual(inst.id, "f202") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.528.1.1007.3.1") XCTAssertEqual(inst.identifier?[0].type?.text, "UZI-nummer") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "12345678902") XCTAssertEqual(inst.identifier?[1].system?.absoluteString, "https://www.bigregister.nl/") XCTAssertEqual(inst.identifier?[1].type?.text, "BIG-nummer") - XCTAssertEqual(inst.identifier?[1].use, "official") + XCTAssertEqual(inst.identifier?[1].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[1].value, "12345678902") XCTAssertEqual(inst.name?[0].family?[0], "Maas") XCTAssertEqual(inst.name?[0].given?[0], "Luigi") XCTAssertEqual(inst.name?[0].prefix?[0], "Dr.") XCTAssertEqual(inst.name?[0].text, "Luigi Maas") - XCTAssertEqual(inst.name?[0].use, "official") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) XCTAssertEqual(inst.role?[0].code?.coding?[0].code, "33526004") XCTAssertEqual(inst.role?[0].code?.coding?[0].display, "Electronic laboratory reporting") XCTAssertEqual(inst.role?[0].code?.coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -520,10 +520,10 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].code, "159285000") XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].display, "Medical laboratory technician") XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "+31715269111") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -547,20 +547,20 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.address?[0].country, "NLD") XCTAssertEqual(inst.address?[0].line?[0], "Walvisbaai 3") XCTAssertEqual(inst.address?[0].postalCode, "2333ZA") - XCTAssertEqual(inst.address?[0].use, "work") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "work")!) XCTAssertEqual(inst.birthDate?.description, "1983-04-20") - XCTAssertEqual(inst.gender, "male") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "male")!) XCTAssertEqual(inst.id, "f203") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.528.1.1007.3.1") XCTAssertEqual(inst.identifier?[0].type?.text, "UZI-nummer") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "12345678903") XCTAssertEqual(inst.identifier?[1].system?.absoluteString, "https://www.bigregister.nl/") XCTAssertEqual(inst.identifier?[1].type?.text, "BIG-nummer") - XCTAssertEqual(inst.identifier?[1].use, "official") + XCTAssertEqual(inst.identifier?[1].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[1].value, "12345678903") XCTAssertEqual(inst.name?[0].text, "Juri van Gelder") - XCTAssertEqual(inst.name?[0].use, "official") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) XCTAssertEqual(inst.role?[0].code?.coding?[0].code, "36682004") XCTAssertEqual(inst.role?[0].code?.coding?[0].display, "Physical therapist") XCTAssertEqual(inst.role?[0].code?.coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -569,10 +569,10 @@ class PractitionerTests: XCTestCase { XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].code, "410158009") XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].display, "Assess physical therapist service") XCTAssertEqual(inst.role?[0].specialty?[0].coding?[0].system?.absoluteString, "http://snomed.info/sct") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "+31715269111") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/ProcedureRequestTests.swift b/Tests/ModelTests/ProcedureRequestTests.swift index 6325d86d..2c06be19 100644 --- a/Tests/ModelTests/ProcedureRequestTests.swift +++ b/Tests/ModelTests/ProcedureRequestTests.swift @@ -2,7 +2,7 @@ // ProcedureRequestTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -40,7 +40,7 @@ class ProcedureRequestTests: XCTestCase { XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.text?.div, "
To be added
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/ProcedureTests.swift b/Tests/ModelTests/ProcedureTests.swift index 8c3b82b3..92c4823e 100644 --- a/Tests/ModelTests/ProcedureTests.swift +++ b/Tests/ModelTests/ProcedureTests.swift @@ -2,7 +2,7 @@ // ProcedureTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -49,10 +49,10 @@ class ProcedureTests: XCTestCase { XCTAssertEqual(inst.performer?[0].actor?.display, "Dr Bert Biopser") XCTAssertEqual(inst.performer?[0].actor?.reference, "Practitioner/example") XCTAssertEqual(inst.reasonCode?[0].text, "Dark lesion l) forearm. getting darker last 3 months.") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, ProcedureStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.text?.div, "
Biopsy of suspected melanoma L) arm
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -92,10 +92,10 @@ class ProcedureTests: XCTestCase { XCTAssertEqual(inst.reasonCode?[0].text, "Heart valve disorder") XCTAssertEqual(inst.report?[0].display, "Lab results blood test") XCTAssertEqual(inst.report?[0].reference, "DiagnosticReport/f001") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, ProcedureStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.display, "P. van de Heuvel") XCTAssertEqual(inst.subject?.reference, "Patient/f001") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -135,10 +135,10 @@ class ProcedureTests: XCTestCase { XCTAssertEqual(inst.reasonCode?[0].text, "Malignant tumor of lung") XCTAssertEqual(inst.report?[0].display, "Lab results blood test") XCTAssertEqual(inst.report?[0].reference, "DiagnosticReport/f001") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, ProcedureStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.display, "P. van de Heuvel") XCTAssertEqual(inst.subject?.reference, "Patient/f001") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -178,10 +178,10 @@ class ProcedureTests: XCTestCase { XCTAssertEqual(inst.reasonCode?[0].text, "abcess in retropharyngeal area") XCTAssertEqual(inst.report?[0].display, "Lab results blood test") XCTAssertEqual(inst.report?[0].reference, "DiagnosticReport/f001") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, ProcedureStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.display, "P. van de Heuvel") XCTAssertEqual(inst.subject?.reference, "Patient/f001") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -221,10 +221,10 @@ class ProcedureTests: XCTestCase { XCTAssertEqual(inst.reasonCode?[0].text, "ensure breathing during surgery") XCTAssertEqual(inst.report?[0].display, "???????????") XCTAssertEqual(inst.report?[0].reference, "DiagnosticReport/f001") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, ProcedureStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.display, "P. van de Heuvel") XCTAssertEqual(inst.subject?.reference, "Patient/f001") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -261,10 +261,10 @@ class ProcedureTests: XCTestCase { XCTAssertEqual(inst.performer?[0].role?.coding?[0].display, "Medical oncologist") XCTAssertEqual(inst.performer?[0].role?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.reasonCode?[0].text, "DiagnosticReport/f201") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, ProcedureStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.display, "Roel") XCTAssertEqual(inst.subject?.reference, "Patient/f201") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -297,9 +297,9 @@ class ProcedureTests: XCTestCase { XCTAssertEqual(inst.performer?[0].actor?.display, "Dr Cecil Surgeon") XCTAssertEqual(inst.performer?[0].actor?.reference, "Practitioner/example") XCTAssertEqual(inst.reasonCode?[0].text, "Bradycardia") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, ProcedureStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -329,10 +329,10 @@ class ProcedureTests: XCTestCase { XCTAssertEqual(inst.performer?[0].actor?.display, "Dr Cecil Surgeon") XCTAssertEqual(inst.performer?[0].actor?.reference, "Practitioner/example") XCTAssertEqual(inst.reasonCode?[0].text, "Generalized abdominal pain 24 hours. Localized in RIF with rebound and guarding") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, ProcedureStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.reference, "Patient/example") XCTAssertEqual(inst.text?.div, "
Routine Appendectomy
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/ProcessRequestTests.swift b/Tests/ModelTests/ProcessRequestTests.swift index e4e611b3..cdf11e75 100644 --- a/Tests/ModelTests/ProcessRequestTests.swift +++ b/Tests/ModelTests/ProcessRequestTests.swift @@ -2,7 +2,7 @@ // ProcessRequestTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -34,15 +34,15 @@ class ProcessRequestTests: XCTestCase { func runProcessRequest1(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.ProcessRequest { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "processrequest-example-poll-eob.json") - XCTAssertEqual(inst.action, "poll") + XCTAssertEqual(inst.action, ActionList(rawValue: "poll")!) XCTAssertEqual(inst.created?.description, "2014-08-16") XCTAssertEqual(inst.id, "1115") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://www.phr.com/patient/12345/processrequest") XCTAssertEqual(inst.identifier?[0].value, "115") XCTAssertEqual(inst.include?[0], "ExplanationOfBenefit") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ProcessRequestStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Poll ProcessRequest
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -61,7 +61,7 @@ class ProcessRequestTests: XCTestCase { func runProcessRequest2(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.ProcessRequest { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "processrequest-example-poll-exclusive.json") - XCTAssertEqual(inst.action, "poll") + XCTAssertEqual(inst.action, ActionList(rawValue: "poll")!) XCTAssertEqual(inst.created?.description, "2014-08-16") XCTAssertEqual(inst.exclude?[0], "Communication") XCTAssertEqual(inst.exclude?[1], "PaymentReconciliation") @@ -69,9 +69,9 @@ class ProcessRequestTests: XCTestCase { XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://happyvalley.com/processrequest") XCTAssertEqual(inst.identifier?[0].value, "113") XCTAssertEqual(inst.organization?.reference, "Organization/1") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ProcessRequestStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Poll ProcessRequest
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -90,16 +90,16 @@ class ProcessRequestTests: XCTestCase { func runProcessRequest3(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.ProcessRequest { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "processrequest-example-poll-inclusive.json") - XCTAssertEqual(inst.action, "poll") + XCTAssertEqual(inst.action, ActionList(rawValue: "poll")!) XCTAssertEqual(inst.created?.description, "2014-08-16") XCTAssertEqual(inst.id, "1112") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://happyvalley.com/processrequest") XCTAssertEqual(inst.identifier?[0].value, "112") XCTAssertEqual(inst.include?[0], "PaymentReconciliation") XCTAssertEqual(inst.organization?.reference, "Organization/1") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ProcessRequestStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Poll ProcessRequest
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -118,7 +118,7 @@ class ProcessRequestTests: XCTestCase { func runProcessRequest4(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.ProcessRequest { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "processrequest-example-poll-payrec.json") - XCTAssertEqual(inst.action, "poll") + XCTAssertEqual(inst.action, ActionList(rawValue: "poll")!) XCTAssertEqual(inst.created?.description, "2014-08-16") XCTAssertEqual(inst.id, "1114") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://happyvalley.com/processrequest") @@ -127,9 +127,9 @@ class ProcessRequestTests: XCTestCase { XCTAssertEqual(inst.organization?.reference, "Organization/1") XCTAssertEqual(inst.period?.end?.description, "2014-08-20") XCTAssertEqual(inst.period?.start?.description, "2014-08-10") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ProcessRequestStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Poll ProcessRequest
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -148,16 +148,16 @@ class ProcessRequestTests: XCTestCase { func runProcessRequest5(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.ProcessRequest { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "processrequest-example-poll-specific.json") - XCTAssertEqual(inst.action, "poll") + XCTAssertEqual(inst.action, ActionList(rawValue: "poll")!) XCTAssertEqual(inst.created?.description, "2014-08-16") XCTAssertEqual(inst.id, "1111") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://happyvalley.com/processrequest") XCTAssertEqual(inst.identifier?[0].value, "111") XCTAssertEqual(inst.organization?.reference, "Organization/1") XCTAssertEqual(inst.request?.reference, "http://benefitco.com/oralhealthclaim/12345") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ProcessRequestStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Poll ProcessRequest
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -176,7 +176,7 @@ class ProcessRequestTests: XCTestCase { func runProcessRequest6(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.ProcessRequest { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "processrequest-example-reprocess.json") - XCTAssertEqual(inst.action, "reprocess") + XCTAssertEqual(inst.action, ActionList(rawValue: "reprocess")!) XCTAssertEqual(inst.created?.description, "2014-08-16") XCTAssertEqual(inst.id, "44654") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://happyvalley.com/processrequest") @@ -185,9 +185,9 @@ class ProcessRequestTests: XCTestCase { XCTAssertEqual(inst.organization?.reference, "Organization/1") XCTAssertEqual(inst.reference, "ABC12345G") XCTAssertEqual(inst.request?.reference, "http://BenefitsInc.com/fhir/claim/12345") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ProcessRequestStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the ReProcess ProcessRequest resource.
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -206,7 +206,7 @@ class ProcessRequestTests: XCTestCase { func runProcessRequest7(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.ProcessRequest { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "processrequest-example-reverse.json") - XCTAssertEqual(inst.action, "cancel") + XCTAssertEqual(inst.action, ActionList(rawValue: "cancel")!) XCTAssertEqual(inst.created?.description, "2014-08-16") XCTAssertEqual(inst.id, "87654") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://happyvalley.com/processrequest") @@ -214,9 +214,9 @@ class ProcessRequestTests: XCTestCase { XCTAssertFalse(inst.nullify ?? true) XCTAssertEqual(inst.organization?.reference, "Organization/1") XCTAssertEqual(inst.request?.reference, "http://BenefitsInc.com/fhir/claim/12345") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ProcessRequestStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Reversal ProcessRequest
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -235,7 +235,7 @@ class ProcessRequestTests: XCTestCase { func runProcessRequest8(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.ProcessRequest { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "processrequest-example-status.json") - XCTAssertEqual(inst.action, "status") + XCTAssertEqual(inst.action, ActionList(rawValue: "status")!) XCTAssertEqual(inst.created?.description, "2014-08-16") XCTAssertEqual(inst.id, "87655") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://happyvalley.com/processrequest") @@ -243,9 +243,9 @@ class ProcessRequestTests: XCTestCase { XCTAssertEqual(inst.organization?.reference, "Organization/1") XCTAssertEqual(inst.request?.reference, "http://happyvalley.com/claim/12345") XCTAssertEqual(inst.response?.reference, "http://BenefitsInc.com/fhir/claimresponse/3500") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ProcessRequestStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Status ProcessRequest
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -264,15 +264,15 @@ class ProcessRequestTests: XCTestCase { func runProcessRequest9(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.ProcessRequest { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "processrequest-example.json") - XCTAssertEqual(inst.action, "poll") + XCTAssertEqual(inst.action, ActionList(rawValue: "poll")!) XCTAssertEqual(inst.created?.description, "2014-08-16") XCTAssertEqual(inst.id, "1110") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://happyvalley.com/processrequest") XCTAssertEqual(inst.identifier?[0].value, "110") XCTAssertEqual(inst.organization?.reference, "Organization/1") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ProcessRequestStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the Poll ProcessRequest
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/ProcessResponseTests.swift b/Tests/ModelTests/ProcessResponseTests.swift index dd3623a5..ab3a7d7a 100644 --- a/Tests/ModelTests/ProcessResponseTests.swift +++ b/Tests/ModelTests/ProcessResponseTests.swift @@ -2,7 +2,7 @@ // ProcessResponseTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -44,9 +44,9 @@ class ProcessResponseTests: XCTestCase { XCTAssertEqual(inst.outcome?.system?.absoluteString, "http://hl7.org/fhir/processoutcomecodes") XCTAssertEqual(inst.request?.reference, "http://happyvalley.com/fhir/claim/12345") XCTAssertEqual(inst.requestOrganization?.reference, "Organization/1") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ProcessResponseStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
A human-readable rendering of the ProcessResponse
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/ProvenanceTests.swift b/Tests/ModelTests/ProvenanceTests.swift index 10fbaf40..b53f3651 100644 --- a/Tests/ModelTests/ProvenanceTests.swift +++ b/Tests/ModelTests/ProvenanceTests.swift @@ -2,7 +2,7 @@ // ProvenanceTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -56,7 +56,7 @@ class ProvenanceTests: XCTestCase { XCTAssertEqual(inst.signature?[0].whoReference?.reference, "Practitioner/xcda-author") XCTAssertEqual(inst.target?[0].reference, "DocumentReference/example") XCTAssertEqual(inst.text?.div, "
procedure record authored on 27-June 2015 by Harold Hippocrates, MD Content extracted from Referral received 26-June
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -88,7 +88,7 @@ class ProvenanceTests: XCTestCase { XCTAssertEqual(inst.agent?[1].role?.system?.absoluteString, "http://hl7.org/fhir/v3/ParticipationType") XCTAssertEqual(inst.entity?[0].display, "CDA Document in XDS repository") XCTAssertEqual(inst.entity?[0].reference?.absoluteString, "DocumentReference/90f55916-9d15-4b8f-87a9-2d7ade8670c8") - XCTAssertEqual(inst.entity?[0].role, "source") + XCTAssertEqual(inst.entity?[0].role, ProvenanceEntityRole(rawValue: "source")!) XCTAssertEqual(inst.entity?[0].type?.code, "57133-1") XCTAssertEqual(inst.entity?[0].type?.display, "Referral note") XCTAssertEqual(inst.entity?[0].type?.system?.absoluteString, "http://loinc.org") @@ -102,7 +102,7 @@ class ProvenanceTests: XCTestCase { XCTAssertEqual(inst.recorded?.description, "2015-06-27T08:39:24+10:00") XCTAssertEqual(inst.target?[0].reference, "Procedure/example/_history/1") XCTAssertEqual(inst.text?.div, "
procedure record authored on 27-June 2015 by Harold Hippocrates, MD Content extracted from Referral received 26-June
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/QuestionnaireResponseTests.swift b/Tests/ModelTests/QuestionnaireResponseTests.swift index a36c6383..eb983576 100644 --- a/Tests/ModelTests/QuestionnaireResponseTests.swift +++ b/Tests/ModelTests/QuestionnaireResponseTests.swift @@ -2,7 +2,7 @@ // QuestionnaireResponseTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -72,9 +72,9 @@ class QuestionnaireResponseTests: XCTestCase { XCTAssertEqual(inst.item?[0].item?[1].text, "Neonatal Information") XCTAssertEqual(inst.item?[0].linkId, "birthDetails") XCTAssertEqual(inst.item?[0].text, "Birth details - To be completed by health professional") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, QuestionnaireResponseStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.reference, "http://hl7.org/fhir/Patient/1") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -123,10 +123,10 @@ class QuestionnaireResponseTests: XCTestCase { XCTAssertEqual(inst.item?[2].linkId, "3") XCTAssertEqual(inst.item?[2].text, "Intoxications") XCTAssertEqual(inst.source?.reference, "Practitioner/f201") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, QuestionnaireResponseStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.display, "Roel") XCTAssertEqual(inst.subject?.reference, "Patient/f201") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -167,10 +167,10 @@ class QuestionnaireResponseTests: XCTestCase { XCTAssertEqual(inst.item?[2].linkId, "1.3") XCTAssertEqual(inst.questionnaire?.reference, "Questionnaire/gcs") XCTAssertEqual(inst.source?.reference, "Practitioner/f007") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, QuestionnaireResponseStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.display, "Peter James Chalmers") XCTAssertEqual(inst.subject?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -203,9 +203,9 @@ class QuestionnaireResponseTests: XCTestCase { XCTAssertEqual(inst.item?[0].item?[0].answer?[0].valueCoding?.code, "1") XCTAssertEqual(inst.item?[0].item?[0].answer?[0].valueCoding?.display, "Yes") XCTAssertEqual(inst.item?[0].item?[0].answer?[0].valueCoding?.system?.absoluteString, "http://cancer.questionnaire.org/system/code/yesno") - XCTAssertEqual(inst.status, "completed") + XCTAssertEqual(inst.status, QuestionnaireResponseStatus(rawValue: "completed")!) XCTAssertEqual(inst.subject?.reference, "#patsub") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/QuestionnaireTests.swift b/Tests/ModelTests/QuestionnaireTests.swift index 39e075f2..243dedb7 100644 --- a/Tests/ModelTests/QuestionnaireTests.swift +++ b/Tests/ModelTests/QuestionnaireTests.swift @@ -2,7 +2,7 @@ // QuestionnaireTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -38,54 +38,54 @@ class QuestionnaireTests: XCTestCase { XCTAssertEqual(inst.id, "bb") XCTAssertEqual(inst.item?[0].item?[0].item?[0].linkId, "nameOfChild") XCTAssertEqual(inst.item?[0].item?[0].item?[0].text, "Name of child") - XCTAssertEqual(inst.item?[0].item?[0].item?[0].type, "string") + XCTAssertEqual(inst.item?[0].item?[0].item?[0].type, QuestionnaireItemType(rawValue: "string")!) XCTAssertEqual(inst.item?[0].item?[0].item?[1].linkId, "sex") XCTAssertEqual(inst.item?[0].item?[0].item?[1].option?[0].valueCoding?.code, "F") XCTAssertEqual(inst.item?[0].item?[0].item?[1].option?[1].valueCoding?.code, "M") XCTAssertEqual(inst.item?[0].item?[0].item?[1].text, "Sex") - XCTAssertEqual(inst.item?[0].item?[0].item?[1].type, "choice") - XCTAssertEqual(inst.item?[0].item?[0].type, "group") + XCTAssertEqual(inst.item?[0].item?[0].item?[1].type, QuestionnaireItemType(rawValue: "choice")!) + XCTAssertEqual(inst.item?[0].item?[0].type, QuestionnaireItemType(rawValue: "group")!) XCTAssertEqual(inst.item?[0].item?[1].item?[0].linkId, "birthWeight") XCTAssertEqual(inst.item?[0].item?[1].item?[0].text, "Birth weight (kg)") - XCTAssertEqual(inst.item?[0].item?[1].item?[0].type, "decimal") + XCTAssertEqual(inst.item?[0].item?[1].item?[0].type, QuestionnaireItemType(rawValue: "decimal")!) XCTAssertEqual(inst.item?[0].item?[1].item?[1].linkId, "birthLength") XCTAssertEqual(inst.item?[0].item?[1].item?[1].text, "Birth length (cm)") - XCTAssertEqual(inst.item?[0].item?[1].item?[1].type, "decimal") + XCTAssertEqual(inst.item?[0].item?[1].item?[1].type, QuestionnaireItemType(rawValue: "decimal")!) XCTAssertTrue(inst.item?[0].item?[1].item?[2].item?[0].enableWhen?[0].hasAnswer ?? false) XCTAssertEqual(inst.item?[0].item?[1].item?[2].item?[0].enableWhen?[0].question, "vitaminKgiven") XCTAssertEqual(inst.item?[0].item?[1].item?[2].item?[0].item?[0].linkId, "vitaminiKDose1") XCTAssertEqual(inst.item?[0].item?[1].item?[2].item?[0].item?[0].text, "1st dose") - XCTAssertEqual(inst.item?[0].item?[1].item?[2].item?[0].item?[0].type, "dateTime") + XCTAssertEqual(inst.item?[0].item?[1].item?[2].item?[0].item?[0].type, QuestionnaireItemType(rawValue: "dateTime")!) XCTAssertEqual(inst.item?[0].item?[1].item?[2].item?[0].item?[1].linkId, "vitaminiKDose2") XCTAssertEqual(inst.item?[0].item?[1].item?[2].item?[0].item?[1].text, "2nd dose") - XCTAssertEqual(inst.item?[0].item?[1].item?[2].item?[0].item?[1].type, "dateTime") + XCTAssertEqual(inst.item?[0].item?[1].item?[2].item?[0].item?[1].type, QuestionnaireItemType(rawValue: "dateTime")!) XCTAssertEqual(inst.item?[0].item?[1].item?[2].item?[0].linkId, "vitaminKgivenDoses") - XCTAssertEqual(inst.item?[0].item?[1].item?[2].item?[0].type, "group") + XCTAssertEqual(inst.item?[0].item?[1].item?[2].item?[0].type, QuestionnaireItemType(rawValue: "group")!) XCTAssertEqual(inst.item?[0].item?[1].item?[2].linkId, "vitaminKgiven") XCTAssertEqual(inst.item?[0].item?[1].item?[2].option?[0].valueCoding?.code, "INJECTION") XCTAssertEqual(inst.item?[0].item?[1].item?[2].option?[1].valueCoding?.code, "INTRAVENOUS") XCTAssertEqual(inst.item?[0].item?[1].item?[2].option?[2].valueCoding?.code, "ORAL") XCTAssertEqual(inst.item?[0].item?[1].item?[2].text, "Vitamin K given") - XCTAssertEqual(inst.item?[0].item?[1].item?[2].type, "choice") + XCTAssertEqual(inst.item?[0].item?[1].item?[2].type, QuestionnaireItemType(rawValue: "choice")!) XCTAssertEqual(inst.item?[0].item?[1].item?[3].item?[0].linkId, "hepBgivenDate") XCTAssertEqual(inst.item?[0].item?[1].item?[3].item?[0].text, "Date given") - XCTAssertEqual(inst.item?[0].item?[1].item?[3].item?[0].type, "date") + XCTAssertEqual(inst.item?[0].item?[1].item?[3].item?[0].type, QuestionnaireItemType(rawValue: "date")!) XCTAssertEqual(inst.item?[0].item?[1].item?[3].linkId, "hepBgiven") XCTAssertEqual(inst.item?[0].item?[1].item?[3].text, "Hep B given y / n") - XCTAssertEqual(inst.item?[0].item?[1].item?[3].type, "boolean") + XCTAssertEqual(inst.item?[0].item?[1].item?[3].type, QuestionnaireItemType(rawValue: "boolean")!) XCTAssertEqual(inst.item?[0].item?[1].item?[4].linkId, "abnormalitiesAtBirth") XCTAssertEqual(inst.item?[0].item?[1].item?[4].text, "Abnormalities noted at birth") - XCTAssertEqual(inst.item?[0].item?[1].item?[4].type, "string") + XCTAssertEqual(inst.item?[0].item?[1].item?[4].type, QuestionnaireItemType(rawValue: "string")!) XCTAssertEqual(inst.item?[0].item?[1].linkId, "neonatalInformation") XCTAssertEqual(inst.item?[0].item?[1].text, "Neonatal Information") - XCTAssertEqual(inst.item?[0].item?[1].type, "group") + XCTAssertEqual(inst.item?[0].item?[1].type, QuestionnaireItemType(rawValue: "group")!) XCTAssertEqual(inst.item?[0].linkId, "birthDetails") XCTAssertEqual(inst.item?[0].text, "Birth details - To be completed by health professional") - XCTAssertEqual(inst.item?[0].type, "group") + XCTAssertEqual(inst.item?[0].type, QuestionnaireItemType(rawValue: "group")!) XCTAssertEqual(inst.publisher, "New South Wales Department of Health") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.status, QuestionnaireStatus(rawValue: "draft")!) XCTAssertEqual(inst.subjectType?[0], "Patient") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.title, "NSW Government My Personal Health Record") XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/Questionnaire/bb") @@ -113,34 +113,34 @@ class QuestionnaireTests: XCTestCase { XCTAssertEqual(inst.id, "f201") XCTAssertEqual(inst.item?[0].linkId, "1") XCTAssertEqual(inst.item?[0].text, "Do you have allergies?") - XCTAssertEqual(inst.item?[0].type, "boolean") + XCTAssertEqual(inst.item?[0].type, QuestionnaireItemType(rawValue: "boolean")!) XCTAssertEqual(inst.item?[1].item?[0].linkId, "2.1") XCTAssertEqual(inst.item?[1].item?[0].text, "What is your gender?") - XCTAssertEqual(inst.item?[1].item?[0].type, "string") + XCTAssertEqual(inst.item?[1].item?[0].type, QuestionnaireItemType(rawValue: "string")!) XCTAssertEqual(inst.item?[1].item?[1].linkId, "2.2") XCTAssertEqual(inst.item?[1].item?[1].text, "What is your date of birth?") - XCTAssertEqual(inst.item?[1].item?[1].type, "date") + XCTAssertEqual(inst.item?[1].item?[1].type, QuestionnaireItemType(rawValue: "date")!) XCTAssertEqual(inst.item?[1].item?[2].linkId, "2.3") XCTAssertEqual(inst.item?[1].item?[2].text, "What is your country of birth?") - XCTAssertEqual(inst.item?[1].item?[2].type, "string") + XCTAssertEqual(inst.item?[1].item?[2].type, QuestionnaireItemType(rawValue: "string")!) XCTAssertEqual(inst.item?[1].item?[3].linkId, "2.4") XCTAssertEqual(inst.item?[1].item?[3].text, "What is your marital status?") - XCTAssertEqual(inst.item?[1].item?[3].type, "string") + XCTAssertEqual(inst.item?[1].item?[3].type, QuestionnaireItemType(rawValue: "string")!) XCTAssertEqual(inst.item?[1].linkId, "2") XCTAssertEqual(inst.item?[1].text, "General questions") - XCTAssertEqual(inst.item?[1].type, "group") + XCTAssertEqual(inst.item?[1].type, QuestionnaireItemType(rawValue: "group")!) XCTAssertEqual(inst.item?[2].item?[0].linkId, "3.1") XCTAssertEqual(inst.item?[2].item?[0].text, "Do you smoke?") - XCTAssertEqual(inst.item?[2].item?[0].type, "boolean") + XCTAssertEqual(inst.item?[2].item?[0].type, QuestionnaireItemType(rawValue: "boolean")!) XCTAssertEqual(inst.item?[2].item?[1].linkId, "3.2") XCTAssertEqual(inst.item?[2].item?[1].text, "Do you drink alchohol?") - XCTAssertEqual(inst.item?[2].item?[1].type, "boolean") + XCTAssertEqual(inst.item?[2].item?[1].type, QuestionnaireItemType(rawValue: "boolean")!) XCTAssertEqual(inst.item?[2].linkId, "3") XCTAssertEqual(inst.item?[2].text, "Intoxications") - XCTAssertEqual(inst.item?[2].type, "group") - XCTAssertEqual(inst.status, "published") + XCTAssertEqual(inst.item?[2].type, QuestionnaireItemType(rawValue: "group")!) + XCTAssertEqual(inst.status, QuestionnaireStatus(rawValue: "published")!) XCTAssertEqual(inst.subjectType?[0], "Patient") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/Questionnaire/f201") return inst @@ -171,21 +171,21 @@ class QuestionnaireTests: XCTestCase { XCTAssertEqual(inst.item?[0].concept?[0].system?.absoluteString, "http://loinc.org") XCTAssertEqual(inst.item?[0].linkId, "1.1") XCTAssertEqual(inst.item?[0].options?.reference, "#verbal") - XCTAssertEqual(inst.item?[0].type, "choice") + XCTAssertEqual(inst.item?[0].type, QuestionnaireItemType(rawValue: "choice")!) XCTAssertEqual(inst.item?[1].concept?[0].code, "9268-4") XCTAssertEqual(inst.item?[1].concept?[0].system?.absoluteString, "http://loinc.org") XCTAssertEqual(inst.item?[1].linkId, "1.2") XCTAssertEqual(inst.item?[1].options?.reference, "#motor") - XCTAssertEqual(inst.item?[1].type, "choice") + XCTAssertEqual(inst.item?[1].type, QuestionnaireItemType(rawValue: "choice")!) XCTAssertEqual(inst.item?[2].concept?[0].code, "9267-6") XCTAssertEqual(inst.item?[2].concept?[0].system?.absoluteString, "http://loinc.org") XCTAssertEqual(inst.item?[2].linkId, "1.3") XCTAssertEqual(inst.item?[2].options?.reference, "#eye") - XCTAssertEqual(inst.item?[2].type, "choice") + XCTAssertEqual(inst.item?[2].type, QuestionnaireItemType(rawValue: "choice")!) XCTAssertEqual(inst.publisher, "FHIR Project team") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.status, QuestionnaireStatus(rawValue: "draft")!) XCTAssertEqual(inst.subjectType?[0], "Patient") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.title, "Glasgow Coma Score") XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/Questionnaire/gcs") @@ -218,7 +218,7 @@ class QuestionnaireTests: XCTestCase { XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[0].concept?[0].system?.absoluteString, "http://example.org/system/code/questions") XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[0].linkId, "1.1.1.1") XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[0].options?.reference, "http://hl7.org/fhir/ValueSet/yesnodontknow") - XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[0].type, "choice") + XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[0].type, QuestionnaireItemType(rawValue: "choice")!) XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[1].concept?[0].code, "COMCAR00") XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[1].concept?[0].display, "Angina Pectoris") XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[1].concept?[0].system?.absoluteString, "http://example.org/system/code/questions") @@ -227,20 +227,20 @@ class QuestionnaireTests: XCTestCase { XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[1].concept?[1].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[1].linkId, "1.1.1.2") XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[1].options?.reference, "http://hl7.org/fhir/ValueSet/yesnodontknow") - XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[1].type, "choice") + XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[1].type, QuestionnaireItemType(rawValue: "choice")!) XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[2].concept?[0].code, "22298006") XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[2].concept?[0].display, "Myocardial infarction (disorder)") XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[2].concept?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[2].linkId, "1.1.1.3") XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[2].options?.reference, "http://hl7.org/fhir/ValueSet/yesnodontknow") - XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[2].type, "choice") + XCTAssertEqual(inst.item?[0].item?[0].item?[0].item?[2].type, QuestionnaireItemType(rawValue: "choice")!) XCTAssertEqual(inst.item?[0].item?[0].item?[0].linkId, "1.1.1") - XCTAssertEqual(inst.item?[0].item?[0].item?[0].type, "group") + XCTAssertEqual(inst.item?[0].item?[0].item?[0].type, QuestionnaireItemType(rawValue: "group")!) XCTAssertEqual(inst.item?[0].item?[0].linkId, "1.1") XCTAssertEqual(inst.item?[0].item?[0].options?.reference, "http://hl7.org/fhir/ValueSet/yesnodontknow") - XCTAssertEqual(inst.item?[0].item?[0].type, "choice") + XCTAssertEqual(inst.item?[0].item?[0].type, QuestionnaireItemType(rawValue: "choice")!) XCTAssertEqual(inst.item?[0].linkId, "1") - XCTAssertEqual(inst.item?[0].type, "group") + XCTAssertEqual(inst.item?[0].type, QuestionnaireItemType(rawValue: "group")!) XCTAssertEqual(inst.item?[1].concept?[0].code, "HISTOPATHOLOGY") XCTAssertEqual(inst.item?[1].concept?[0].system?.absoluteString, "http://example.org/system/code/sections") XCTAssertEqual(inst.item?[1].item?[0].concept?[0].code, "ABDOMINAL") @@ -249,14 +249,14 @@ class QuestionnaireTests: XCTestCase { XCTAssertEqual(inst.item?[1].item?[0].item?[0].concept?[0].display, "pT category") XCTAssertEqual(inst.item?[1].item?[0].item?[0].concept?[0].system?.absoluteString, "http://example.org/system/code/questions") XCTAssertEqual(inst.item?[1].item?[0].item?[0].linkId, "2.1.2") - XCTAssertEqual(inst.item?[1].item?[0].item?[0].type, "choice") + XCTAssertEqual(inst.item?[1].item?[0].item?[0].type, QuestionnaireItemType(rawValue: "choice")!) XCTAssertEqual(inst.item?[1].item?[0].linkId, "2.1") - XCTAssertEqual(inst.item?[1].item?[0].type, "group") + XCTAssertEqual(inst.item?[1].item?[0].type, QuestionnaireItemType(rawValue: "group")!) XCTAssertEqual(inst.item?[1].linkId, "2") - XCTAssertEqual(inst.item?[1].type, "group") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.item?[1].type, QuestionnaireItemType(rawValue: "group")!) + XCTAssertEqual(inst.status, QuestionnaireStatus(rawValue: "draft")!) XCTAssertEqual(inst.subjectType?[0], "Patient") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.title, "Cancer Quality Forum Questionnaire 2012") XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/Questionnaire/3141") diff --git a/Tests/ModelTests/ReferralRequestTests.swift b/Tests/ModelTests/ReferralRequestTests.swift index 37f74cd1..efac06a8 100644 --- a/Tests/ModelTests/ReferralRequestTests.swift +++ b/Tests/ModelTests/ReferralRequestTests.swift @@ -2,7 +2,7 @@ // ReferralRequestTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -35,7 +35,7 @@ class ReferralRequestTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "referralrequest-example.json") XCTAssertEqual(inst.authored?.description, "2014-02-14") - XCTAssertEqual(inst.category, "request") + XCTAssertEqual(inst.category, ReferralCategory(rawValue: "request")!) XCTAssertEqual(inst.description_fhir, "In the past 2 years Beverly has had 6 instances of r) sided Otitis media. She is falling behind her peers at school, and displaying some learning difficulties.") XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://orionhealth.com/fhir/apps/referralids") @@ -57,9 +57,9 @@ class ReferralRequestTests: XCTestCase { XCTAssertEqual(inst.specialty?.coding?[0].code, "ent") XCTAssertEqual(inst.specialty?.coding?[0].display, "ENT") XCTAssertEqual(inst.specialty?.coding?[0].system?.absoluteString, "http://orionhealth.com/fhir/apps/specialties") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, ReferralStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
Referral to Dr Dave for Beverly weaver to have grommets inserted in her r) ear
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "rfs") XCTAssertEqual(inst.type?.coding?[0].display, "Referral for service") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://orionhealth.com/fhir/apps/referraltypes") diff --git a/Tests/ModelTests/RelatedPersonTests.swift b/Tests/ModelTests/RelatedPersonTests.swift index 52a211d7..8003cabb 100644 --- a/Tests/ModelTests/RelatedPersonTests.swift +++ b/Tests/ModelTests/RelatedPersonTests.swift @@ -2,7 +2,7 @@ // RelatedPersonTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -34,24 +34,24 @@ class RelatedPersonTests: XCTestCase { func runRelatedPerson1(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.RelatedPerson { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "relatedperson-example-f001-sarah.json") - XCTAssertEqual(inst.gender, "female") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "female")!) XCTAssertEqual(inst.id, "f001") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:2.16.840.1.113883.2.4.6.3") XCTAssertEqual(inst.identifier?[0].type?.text, "BSN") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.name?[0].family?[0], "Abels") XCTAssertEqual(inst.name?[0].given?[0], "Sarah") - XCTAssertEqual(inst.name?[0].use, "usual") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "usual")!) XCTAssertEqual(inst.patient?.reference, "Patient/f001") XCTAssertEqual(inst.relationship?.coding?[0].code, "SIGOTHR") XCTAssertEqual(inst.relationship?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/RoleCode") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "mobile") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "mobile")!) XCTAssertEqual(inst.telecom?[0].value, "0690383372") - XCTAssertEqual(inst.telecom?[1].system, "email") - XCTAssertEqual(inst.telecom?[1].use, "home") + XCTAssertEqual(inst.telecom?[1].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.telecom?[1].use, ContactPointUse(rawValue: "home")!) XCTAssertEqual(inst.telecom?[1].value, "s.abels@kpn.nl") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -71,19 +71,19 @@ class RelatedPersonTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "relatedperson-example-f002-ariadne.json") XCTAssertEqual(inst.birthDate?.description, "1963") - XCTAssertEqual(inst.gender, "female") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "female")!) XCTAssertEqual(inst.id, "f002") XCTAssertEqual(inst.name?[0].text, "Ariadne Bor-Jansma") - XCTAssertEqual(inst.name?[0].use, "usual") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "usual")!) XCTAssertEqual(inst.patient?.reference, "Patient/f201") XCTAssertEqual(inst.period?.start?.description, "1975") XCTAssertEqual(inst.photo?[0].contentType, "image/jpeg") XCTAssertEqual(inst.relationship?.coding?[0].code, "SIGOTHR") XCTAssertEqual(inst.relationship?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v3/RoleCode") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "home") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "home")!) XCTAssertEqual(inst.telecom?[0].value, "+31201234567") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -106,23 +106,23 @@ class RelatedPersonTests: XCTestCase { XCTAssertEqual(inst.address?[0].line?[0], "534 Erewhon St") XCTAssertEqual(inst.address?[0].postalCode, "3999") XCTAssertEqual(inst.address?[0].state, "Vic") - XCTAssertEqual(inst.address?[0].use, "home") - XCTAssertEqual(inst.gender, "male") + XCTAssertEqual(inst.address?[0].use, AddressUse(rawValue: "home")!) + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "male")!) XCTAssertEqual(inst.id, "peter") XCTAssertEqual(inst.name?[0].family?[0], "Chalmers") XCTAssertEqual(inst.name?[0].given?[0], "Peter") XCTAssertEqual(inst.name?[0].given?[1], "James") - XCTAssertEqual(inst.name?[0].use, "official") + XCTAssertEqual(inst.name?[0].use, NameUse(rawValue: "official")!) XCTAssertEqual(inst.patient?.reference, "Patient/animal") XCTAssertEqual(inst.period?.start?.description, "2012-03-11") XCTAssertEqual(inst.photo?[0].contentType, "image/jpeg") XCTAssertEqual(inst.photo?[0].url?.absoluteString, "Binary/f012") XCTAssertEqual(inst.relationship?.coding?[0].code, "owner") XCTAssertEqual(inst.relationship?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/patient-contact-relationship") - XCTAssertEqual(inst.telecom?[0].system, "phone") - XCTAssertEqual(inst.telecom?[0].use, "work") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) + XCTAssertEqual(inst.telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.telecom?[0].value, "(03) 5555 6473") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -146,11 +146,11 @@ class RelatedPersonTests: XCTestCase { XCTAssertEqual(inst.address?[0].country, "FRA") XCTAssertEqual(inst.address?[0].line?[0], "43, Place du Marché Sainte Catherine") XCTAssertEqual(inst.address?[0].postalCode, "75004") - XCTAssertEqual(inst.gender, "female") + XCTAssertEqual(inst.gender, AdministrativeGender(rawValue: "female")!) XCTAssertEqual(inst.id, "benedicte") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:oid:1.2.250.1.61") XCTAssertEqual(inst.identifier?[0].type?.text, "INSEE") - XCTAssertEqual(inst.identifier?[0].use, "usual") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[0].value, "272117510400399") XCTAssertEqual(inst.name?[0].family?[0], "du") XCTAssertEqual(inst.name?[0].family?[1], "Marché") @@ -162,9 +162,9 @@ class RelatedPersonTests: XCTestCase { XCTAssertEqual(inst.relationship?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/patient-contact-relationship") XCTAssertEqual(inst.relationship?.coding?[1].code, "WIFE") XCTAssertEqual(inst.relationship?.coding?[1].system?.absoluteString, "http://hl7.org/fhir/v3/RoleCode") - XCTAssertEqual(inst.telecom?[0].system, "phone") + XCTAssertEqual(inst.telecom?[0].system, ContactPointSystem(rawValue: "phone")!) XCTAssertEqual(inst.telecom?[0].value, "+33 (237) 998327") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/RequestGroupTests.swift b/Tests/ModelTests/RequestGroupTests.swift index 0117ee62..7be00df9 100644 --- a/Tests/ModelTests/RequestGroupTests.swift +++ b/Tests/ModelTests/RequestGroupTests.swift @@ -2,7 +2,7 @@ // RequestGroupTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -36,7 +36,7 @@ class RequestGroupTests: XCTestCase { XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.text?.div, "
[Put rendering here]
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/RiskAssessmentTests.swift b/Tests/ModelTests/RiskAssessmentTests.swift index 7dfffeb3..582b7d89 100644 --- a/Tests/ModelTests/RiskAssessmentTests.swift +++ b/Tests/ModelTests/RiskAssessmentTests.swift @@ -2,7 +2,7 @@ // RiskAssessmentTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -50,8 +50,8 @@ class RiskAssessmentTests: XCTestCase { XCTAssertEqual(inst.prediction?[0].whenRange?.low?.system?.absoluteString, "http://unitsofmeasure.org") XCTAssertEqual(inst.prediction?[0].whenRange?.low?.unit, "years") XCTAssertEqual(inst.prediction?[0].whenRange?.low?.value, NSDecimalNumber(string: "39")) - XCTAssertEqual(inst.status, "final") - XCTAssertEqual(inst.text?.status, "additional") + XCTAssertEqual(inst.status, ObservationStatus(rawValue: "final")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "additional")!) return inst } @@ -71,8 +71,8 @@ class RiskAssessmentTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "riskassessment-example-population.json") XCTAssertEqual(inst.id, "population") - XCTAssertEqual(inst.status, "final") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, ObservationStatus(rawValue: "final")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -101,8 +101,8 @@ class RiskAssessmentTests: XCTestCase { XCTAssertEqual(inst.prediction?[0].probabilityCodeableConcept?.coding?[0].code, "moderate") XCTAssertEqual(inst.prediction?[0].probabilityCodeableConcept?.coding?[0].display, "moderate likelihood") XCTAssertEqual(inst.prediction?[0].probabilityCodeableConcept?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/risk-probability") - XCTAssertEqual(inst.status, "final") - XCTAssertEqual(inst.text?.status, "additional") + XCTAssertEqual(inst.status, ObservationStatus(rawValue: "final")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "additional")!) return inst } @@ -201,8 +201,8 @@ class RiskAssessmentTests: XCTestCase { XCTAssertEqual(inst.prediction?[7].whenRange?.low?.system?.absoluteString, "http://unitsofmeasure.org") XCTAssertEqual(inst.prediction?[7].whenRange?.low?.unit, "years") XCTAssertEqual(inst.prediction?[7].whenRange?.low?.value, NSDecimalNumber(string: "83")) - XCTAssertEqual(inst.status, "final") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, ObservationStatus(rawValue: "final")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/ScheduleTests.swift b/Tests/ModelTests/ScheduleTests.swift index 6e0027b9..94473f48 100644 --- a/Tests/ModelTests/ScheduleTests.swift +++ b/Tests/ModelTests/ScheduleTests.swift @@ -2,7 +2,7 @@ // ScheduleTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -40,7 +40,7 @@ class ScheduleTests: XCTestCase { XCTAssertEqual(inst.comment, "The slots attached to this schedule should be specialized to cover immunizations within the clinic") XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://example.org/scheduleid") - XCTAssertEqual(inst.identifier?[0].use, "usual") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "usual")!) XCTAssertEqual(inst.identifier?[0].value, "45") XCTAssertEqual(inst.planningHorizon?.end?.description, "2013-12-25T09:30:00Z") XCTAssertEqual(inst.planningHorizon?.start?.description, "2013-12-25T09:15:00Z") @@ -50,7 +50,7 @@ class ScheduleTests: XCTestCase { XCTAssertEqual(inst.serviceType?[0].coding?[0].display, "Immunization") XCTAssertEqual(inst.specialty?[0].coding?[0].code, "408480009") XCTAssertEqual(inst.specialty?[0].coding?[0].display, "Clinical immunology") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/SearchParameterTests.swift b/Tests/ModelTests/SearchParameterTests.swift index acd5a409..0a7ec7fc 100644 --- a/Tests/ModelTests/SearchParameterTests.swift +++ b/Tests/ModelTests/SearchParameterTests.swift @@ -2,7 +2,7 @@ // SearchParameterTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -36,20 +36,20 @@ class SearchParameterTests: XCTestCase { XCTAssertEqual(inst.base, "Patient") XCTAssertEqual(inst.code, "part-agree") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "http://hl7.org/fhir") XCTAssertEqual(inst.description_fhir, "Search by url for a participation agreement, which is stored in a DocumentReference") XCTAssertTrue(inst.experimental ?? false) XCTAssertEqual(inst.id, "example-extension") XCTAssertEqual(inst.name, "Example Search Parameter on an extension") XCTAssertEqual(inst.publisher, "Health Level Seven International (FHIR Infrastructure)") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) XCTAssertEqual(inst.target?[0], "DocumentReference") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.type, "reference") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.type, SearchParamType(rawValue: "reference")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/SearchParameter/example-extension") XCTAssertEqual(inst.xpath, "f:DocumentReference/f:extension[@url='http://example.org/fhir/StructureDefinition/participation-agreement']") - XCTAssertEqual(inst.xpathUsage, "normal") + XCTAssertEqual(inst.xpathUsage, XPathUsageType(rawValue: "normal")!) return inst } @@ -71,7 +71,7 @@ class SearchParameterTests: XCTestCase { XCTAssertEqual(inst.base, "Resource") XCTAssertEqual(inst.code, "_id") XCTAssertEqual(inst.contact?[0].name, "[string]") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "http://hl7.org/fhir") XCTAssertEqual(inst.date?.description, "2013-10-23") XCTAssertEqual(inst.description_fhir, "Search by resource identifier - e.g. same as the read interaction, but can return included resources") @@ -80,12 +80,12 @@ class SearchParameterTests: XCTestCase { XCTAssertEqual(inst.name, "Example Search Parameter") XCTAssertEqual(inst.publisher, "Health Level Seven International (FHIR Infrastructure)") XCTAssertEqual(inst.purpose, "Need to search by identifier for various infrastructural cases - mainly retrieving packages, and matching as part of a chain") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.text?.status, "generated") - XCTAssertEqual(inst.type, "token") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) + XCTAssertEqual(inst.type, SearchParamType(rawValue: "token")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/SearchParameter/example") XCTAssertEqual(inst.xpath, "f:*/f:id") - XCTAssertEqual(inst.xpathUsage, "normal") + XCTAssertEqual(inst.xpathUsage, XPathUsageType(rawValue: "normal")!) return inst } diff --git a/Tests/ModelTests/SequenceTests.swift b/Tests/ModelTests/SequenceTests.swift index 62353782..7ba7b46a 100644 --- a/Tests/ModelTests/SequenceTests.swift +++ b/Tests/ModelTests/SequenceTests.swift @@ -2,7 +2,7 @@ // SequenceTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -45,7 +45,7 @@ class SequenceTests: XCTestCase { XCTAssertEqual(inst.repository?[0].name, "ga4gh") XCTAssertEqual(inst.repository?[0].url?.absoluteString, "https://www.googleapis.com/genomics/v1beta2") XCTAssertEqual(inst.repository?[0].variantId, "A1A2") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type, "DNA") XCTAssertEqual(inst.variant?[0].end, 55227977) XCTAssertEqual(inst.variant?[0].observedAllele, "T") diff --git a/Tests/ModelTests/ServiceDefinitionTests.swift b/Tests/ModelTests/ServiceDefinitionTests.swift index 9b14058b..4ff8c6de 100644 --- a/Tests/ModelTests/ServiceDefinitionTests.swift +++ b/Tests/ModelTests/ServiceDefinitionTests.swift @@ -2,7 +2,7 @@ // ServiceDefinitionTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -37,11 +37,11 @@ class ServiceDefinitionTests: XCTestCase { XCTAssertEqual(inst.date?.description, "2015-07-22") XCTAssertEqual(inst.description_fhir, "Guideline appropriate ordering is used to assess appropriateness of an order given a patient, a proposed order, and a set of clinical indications.") XCTAssertEqual(inst.id, "example") - XCTAssertEqual(inst.identifier?[0].use, "official") + XCTAssertEqual(inst.identifier?[0].use, IdentifierUse(rawValue: "official")!) XCTAssertEqual(inst.identifier?[0].value, "guildeline-appropriate-ordering") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) XCTAssertEqual(inst.text?.div, "
Guideline Appropriate Ordering Module
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.title, "Guideline Appropriate Ordering Module") XCTAssertEqual(inst.topic?[0].text, "Guideline Appropriate Ordering") XCTAssertEqual(inst.topic?[1].text, "Appropriate Use Criteria") diff --git a/Tests/ModelTests/SlotTests.swift b/Tests/ModelTests/SlotTests.swift index a18e57e6..1f6e486e 100644 --- a/Tests/ModelTests/SlotTests.swift +++ b/Tests/ModelTests/SlotTests.swift @@ -2,7 +2,7 @@ // SlotTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -44,8 +44,8 @@ class SlotTests: XCTestCase { XCTAssertEqual(inst.serviceCategory?.coding?[0].code, "17") XCTAssertEqual(inst.serviceCategory?.coding?[0].display, "General Practice") XCTAssertEqual(inst.start?.description, "2013-12-25T09:00:00Z") - XCTAssertEqual(inst.status, "busy") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, SlotStatus(rawValue: "busy")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -71,8 +71,8 @@ class SlotTests: XCTestCase { XCTAssertEqual(inst.serviceCategory?.coding?[0].code, "17") XCTAssertEqual(inst.serviceCategory?.coding?[0].display, "General Practice") XCTAssertEqual(inst.start?.description, "2013-12-25T09:45:00Z") - XCTAssertEqual(inst.status, "busy-tentative") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, SlotStatus(rawValue: "busy-tentative")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -98,8 +98,8 @@ class SlotTests: XCTestCase { XCTAssertEqual(inst.serviceCategory?.coding?[0].code, "17") XCTAssertEqual(inst.serviceCategory?.coding?[0].display, "General Practice") XCTAssertEqual(inst.start?.description, "2013-12-25T09:30:00Z") - XCTAssertEqual(inst.status, "busy-unavailable") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, SlotStatus(rawValue: "busy-unavailable")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -132,8 +132,8 @@ class SlotTests: XCTestCase { XCTAssertEqual(inst.specialty?[0].coding?[0].code, "408480009") XCTAssertEqual(inst.specialty?[0].coding?[0].display, "Clinical immunology") XCTAssertEqual(inst.start?.description, "2013-12-25T09:15:00Z") - XCTAssertEqual(inst.status, "free") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, SlotStatus(rawValue: "free")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/SpecimenTests.swift b/Tests/ModelTests/SpecimenTests.swift index c241f84b..6358fd50 100644 --- a/Tests/ModelTests/SpecimenTests.swift +++ b/Tests/ModelTests/SpecimenTests.swift @@ -2,7 +2,7 @@ // SpecimenTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -45,9 +45,9 @@ class SpecimenTests: XCTestCase { XCTAssertEqual(inst.note?[0].text, "Patient dropped off specimen") XCTAssertEqual(inst.parent?[0].reference, "#stool") XCTAssertEqual(inst.receivedTime?.description, "2015-08-18T07:03:00Z") - XCTAssertEqual(inst.status, "available") + XCTAssertEqual(inst.status, SpecimenStatus(rawValue: "available")!) XCTAssertEqual(inst.subject?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "429951000124103") XCTAssertEqual(inst.type?.coding?[0].display, "Bacterial isolate specimen") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -79,7 +79,7 @@ class SpecimenTests: XCTestCase { XCTAssertEqual(inst.id, "sst") XCTAssertEqual(inst.request?[0].reference, "DiagnosticRequest/ft4") XCTAssertEqual(inst.subject?.reference, "Patient/pat2") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "119364003") XCTAssertEqual(inst.type?.coding?[0].display, "Serum sample") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://snomed.info/sct") @@ -112,9 +112,9 @@ class SpecimenTests: XCTestCase { XCTAssertEqual(inst.container?[0].type?.text, "Non-sterile specimen container") XCTAssertEqual(inst.id, "vma-urine") XCTAssertEqual(inst.receivedTime?.description, "2015-08-18T07:03:00Z") - XCTAssertEqual(inst.status, "available") + XCTAssertEqual(inst.status, SpecimenStatus(rawValue: "available")!) XCTAssertEqual(inst.subject?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.treatment?[0].description_fhir, "Acidify to pH < 3.0 with 6 N HCl.") XCTAssertEqual(inst.treatment?[0].procedure?.coding?[0].code, "ACID") XCTAssertEqual(inst.treatment?[0].procedure?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/v2/0373") @@ -162,10 +162,10 @@ class SpecimenTests: XCTestCase { XCTAssertEqual(inst.note?[0].text, "Specimen is grossly lipemic") XCTAssertEqual(inst.receivedTime?.description, "2011-03-04T07:03:00Z") XCTAssertEqual(inst.request?[0].reference, "DiagnosticRequest/example") - XCTAssertEqual(inst.status, "available") + XCTAssertEqual(inst.status, SpecimenStatus(rawValue: "available")!) XCTAssertEqual(inst.subject?.display, "Peter Patient") XCTAssertEqual(inst.subject?.reference, "Patient/example") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.type?.coding?[0].code, "122555007") XCTAssertEqual(inst.type?.coding?[0].display, "Venous blood specimen") XCTAssertEqual(inst.type?.coding?[0].system?.absoluteString, "http://snomed.info/sct") diff --git a/Tests/ModelTests/StructureDefinitionTests.swift b/Tests/ModelTests/StructureDefinitionTests.swift index 9aa5190f..e4c20626 100644 --- a/Tests/ModelTests/StructureDefinitionTests.swift +++ b/Tests/ModelTests/StructureDefinitionTests.swift @@ -2,7 +2,7 @@ // StructureDefinitionTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -36,12 +36,12 @@ class StructureDefinitionTests: XCTestCase { XCTAssertFalse(inst.abstract ?? true) XCTAssertEqual(inst.baseDefinition?.absoluteString, "http://hl7.org/fhir/StructureDefinition/Extension") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "http://hl7.org/special/committees/FHIR") XCTAssertEqual(inst.context?[0], "ElementDefinition") - XCTAssertEqual(inst.contextType, "datatype") + XCTAssertEqual(inst.contextType, ExtensionContext(rawValue: "datatype")!) XCTAssertEqual(inst.date?.description, "2014-01-31") - XCTAssertEqual(inst.derivation, "constraint") + XCTAssertEqual(inst.derivation, TypeDerivationRule(rawValue: "constraint")!) XCTAssertEqual(inst.description_fhir, "An additional example value.") XCTAssertEqual(inst.differential?.element?[0].definition, "An additional example value.") XCTAssertEqual(inst.differential?.element?[0].id, "Extension:anadditionalexamplevalue") @@ -104,7 +104,7 @@ class StructureDefinitionTests: XCTestCase { XCTAssertEqual(inst.differential?.element?[9].type?[0].code?.absoluteString, "uri") XCTAssertEqual(inst.fhirVersion, "1.7.0") XCTAssertEqual(inst.id, "structuredefinition-example") - XCTAssertEqual(inst.kind, "complex-type") + XCTAssertEqual(inst.kind, StructureDefinitionKind(rawValue: "complex-type")!) XCTAssertEqual(inst.mapping?[0].identity, "rim") XCTAssertEqual(inst.mapping?[0].name, "RIM Mapping") XCTAssertEqual(inst.mapping?[0].uri?.absoluteString, "http://hl7.org/v3") @@ -117,13 +117,13 @@ class StructureDefinitionTests: XCTestCase { XCTAssertEqual(inst.snapshot?.element?[0].constraint?[0].expression, "children().count() > id.count()") XCTAssertEqual(inst.snapshot?.element?[0].constraint?[0].human, "All FHIR elements must have a @value or children") XCTAssertEqual(inst.snapshot?.element?[0].constraint?[0].key, "ele-1") - XCTAssertEqual(inst.snapshot?.element?[0].constraint?[0].severity, "error") + XCTAssertEqual(inst.snapshot?.element?[0].constraint?[0].severity, ConstraintSeverity(rawValue: "error")!) XCTAssertEqual(inst.snapshot?.element?[0].constraint?[0].source?.absoluteString, "Element") XCTAssertEqual(inst.snapshot?.element?[0].constraint?[0].xpath, "@value|f:*|h:div") XCTAssertEqual(inst.snapshot?.element?[0].constraint?[1].expression, "extension.exists() != value.exists()") XCTAssertEqual(inst.snapshot?.element?[0].constraint?[1].human, "Must have either extensions or value[x], not both") XCTAssertEqual(inst.snapshot?.element?[0].constraint?[1].key, "ext-1") - XCTAssertEqual(inst.snapshot?.element?[0].constraint?[1].severity, "error") + XCTAssertEqual(inst.snapshot?.element?[0].constraint?[1].severity, ConstraintSeverity(rawValue: "error")!) XCTAssertEqual(inst.snapshot?.element?[0].constraint?[1].source?.absoluteString, "Extension") XCTAssertEqual(inst.snapshot?.element?[0].constraint?[1].xpath, "exists(f:extension)!=exists(f:*[starts-with(local-name(.), 'value')])") XCTAssertEqual(inst.snapshot?.element?[0].definition, "An additional example value.") @@ -142,7 +142,7 @@ class StructureDefinitionTests: XCTestCase { XCTAssertEqual(inst.snapshot?.element?[1].max, "1") XCTAssertEqual(inst.snapshot?.element?[1].min, 0) XCTAssertEqual(inst.snapshot?.element?[1].path, "Extension.id") - XCTAssertEqual(inst.snapshot?.element?[1].representation?[0], "xmlAttr") + XCTAssertEqual(inst.snapshot?.element?[1].representation?[0], PropertyRepresentation(rawValue: "xmlAttr")!) XCTAssertEqual(inst.snapshot?.element?[1].short, "xml:id (or equivalent in JSON)") XCTAssertEqual(inst.snapshot?.element?[1].type?[0].code?.absoluteString, "string") XCTAssertEqual(inst.snapshot?.element?[2].base?.max, "*") @@ -157,7 +157,7 @@ class StructureDefinitionTests: XCTestCase { XCTAssertEqual(inst.snapshot?.element?[2].slicing?.discriminator?[0], "url") XCTAssertEqual(inst.snapshot?.element?[2].slicing?.id, "84") XCTAssertFalse(inst.snapshot?.element?[2].slicing?.ordered ?? true) - XCTAssertEqual(inst.snapshot?.element?[2].slicing?.rules, "open") + XCTAssertEqual(inst.snapshot?.element?[2].slicing?.rules, SlicingRules(rawValue: "open")!) XCTAssertEqual(inst.snapshot?.element?[2].type?[0].code?.absoluteString, "Extension") XCTAssertEqual(inst.snapshot?.element?[3].base?.max, "*") XCTAssertEqual(inst.snapshot?.element?[3].base?.min, 0) @@ -180,7 +180,7 @@ class StructureDefinitionTests: XCTestCase { XCTAssertEqual(inst.snapshot?.element?[4].max, "1") XCTAssertEqual(inst.snapshot?.element?[4].min, 0) XCTAssertEqual(inst.snapshot?.element?[4].path, "Extension.extension.id") - XCTAssertEqual(inst.snapshot?.element?[4].representation?[0], "xmlAttr") + XCTAssertEqual(inst.snapshot?.element?[4].representation?[0], PropertyRepresentation(rawValue: "xmlAttr")!) XCTAssertEqual(inst.snapshot?.element?[4].short, "xml:id (or equivalent in JSON)") XCTAssertEqual(inst.snapshot?.element?[4].type?[0].code?.absoluteString, "string") XCTAssertEqual(inst.snapshot?.element?[5].base?.max, "*") @@ -205,7 +205,7 @@ class StructureDefinitionTests: XCTestCase { XCTAssertEqual(inst.snapshot?.element?[6].max, "1") XCTAssertEqual(inst.snapshot?.element?[6].min, 1) XCTAssertEqual(inst.snapshot?.element?[6].path, "Extension.extension.url") - XCTAssertEqual(inst.snapshot?.element?[6].representation?[0], "xmlAttr") + XCTAssertEqual(inst.snapshot?.element?[6].representation?[0], PropertyRepresentation(rawValue: "xmlAttr")!) XCTAssertEqual(inst.snapshot?.element?[6].short, "identifies the meaning of the extension") XCTAssertEqual(inst.snapshot?.element?[6].type?[0].code?.absoluteString, "uri") XCTAssertEqual(inst.snapshot?.element?[7].base?.max, "1") @@ -241,10 +241,10 @@ class StructureDefinitionTests: XCTestCase { XCTAssertEqual(inst.snapshot?.element?[9].max, "1") XCTAssertEqual(inst.snapshot?.element?[9].min, 0) XCTAssertEqual(inst.snapshot?.element?[9].path, "Extension.extension.id") - XCTAssertEqual(inst.snapshot?.element?[9].representation?[0], "xmlAttr") + XCTAssertEqual(inst.snapshot?.element?[9].representation?[0], PropertyRepresentation(rawValue: "xmlAttr")!) XCTAssertEqual(inst.snapshot?.element?[9].short, "xml:id (or equivalent in JSON)") XCTAssertEqual(inst.snapshot?.element?[9].type?[0].code?.absoluteString, "string") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) XCTAssertEqual(inst.title, "example") XCTAssertEqual(inst.type, "Extension") XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/StructureDefinition/structuredefinition-example") @@ -269,11 +269,11 @@ class StructureDefinitionTests: XCTestCase { XCTAssertFalse(inst.abstract ?? true) XCTAssertEqual(inst.baseDefinition?.absoluteString, "http://hl7.org/fhir/StructureDefinition/DiagnosticReport") XCTAssertEqual(inst.contact?[0].name, "Grahame Grieve") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "email") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "email")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "grahame@healthintersections.com.au") XCTAssertEqual(inst.copyright, "Createive Commons 0, per FHIR specification") XCTAssertEqual(inst.date?.description, "2012-05-12") - XCTAssertEqual(inst.derivation, "constraint") + XCTAssertEqual(inst.derivation, TypeDerivationRule(rawValue: "constraint")!) XCTAssertEqual(inst.description_fhir, "Describes how the lab report is used for a standard Lipid Profile - Cholesterol, Triglyceride and Cholesterol fractions. Uses LOINC codes") XCTAssertTrue(inst.experimental ?? false) XCTAssertEqual(inst.fhirVersion, "1.0.0") @@ -285,7 +285,7 @@ class StructureDefinitionTests: XCTestCase { XCTAssertEqual(inst.keyword?[0].code, "314079002") XCTAssertEqual(inst.keyword?[0].display, "314079002") XCTAssertEqual(inst.keyword?[0].system?.absoluteString, "http://snomed.info/sct") - XCTAssertEqual(inst.kind, "resource") + XCTAssertEqual(inst.kind, StructureDefinitionKind(rawValue: "resource")!) XCTAssertEqual(inst.mapping?[0].comments, "Actual mappings haven't yet been filled out") XCTAssertEqual(inst.mapping?[0].identity, "m1") XCTAssertEqual(inst.mapping?[0].name, "RCPA Lipid Report recommendations") @@ -314,7 +314,7 @@ class StructureDefinitionTests: XCTestCase { XCTAssertEqual(inst.snapshot?.element?[1].short, "Additional Content defined by implementations") XCTAssertEqual(inst.snapshot?.element?[1].slicing?.discriminator?[0], "url") XCTAssertFalse(inst.snapshot?.element?[1].slicing?.ordered ?? true) - XCTAssertEqual(inst.snapshot?.element?[1].slicing?.rules, "open") + XCTAssertEqual(inst.snapshot?.element?[1].slicing?.rules, SlicingRules(rawValue: "open")!) XCTAssertEqual(inst.snapshot?.element?[1].type?[0].code?.absoluteString, "Extension") XCTAssertEqual(inst.snapshot?.element?[2].alias?[0], "narrative") XCTAssertEqual(inst.snapshot?.element?[2].alias?[1], "html") @@ -348,7 +348,7 @@ class StructureDefinitionTests: XCTestCase { XCTAssertEqual(inst.snapshot?.element?[4].base?.max, "1") XCTAssertEqual(inst.snapshot?.element?[4].base?.min, 1) XCTAssertEqual(inst.snapshot?.element?[4].base?.path, "DiagnosticReport.status") - XCTAssertEqual(inst.snapshot?.element?[4].binding?.strength, "required") + XCTAssertEqual(inst.snapshot?.element?[4].binding?.strength, BindingStrength(rawValue: "required")!) XCTAssertEqual(inst.snapshot?.element?[4].binding?.valueSetReference?.reference, "http://hl7.org/fhir/ValueSet/observation-status") XCTAssertEqual(inst.snapshot?.element?[4].comments, "This is labeled as \"Is Modifier\" because applications need to take appropriate action if a report is withdrawn.") XCTAssertEqual(inst.snapshot?.element?[4].definition, "The status of the diagnostic report as a whole.") @@ -423,8 +423,8 @@ class StructureDefinitionTests: XCTestCase { XCTAssertEqual(inst.snapshot?.element?[9].short, "What was requested") XCTAssertEqual(inst.snapshot?.element?[9].type?[0].code?.absoluteString, "Reference") XCTAssertEqual(inst.snapshot?.element?[9].type?[0].targetProfile?.absoluteString, "http://hl7.org/fhir/StructureDefinition/DiagnosticRequest") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.title, "Example Lipid Profile") XCTAssertEqual(inst.type, "DiagnosticReport") XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/StructureDefinition/example") diff --git a/Tests/ModelTests/StructureMapTests.swift b/Tests/ModelTests/StructureMapTests.swift index cc758bf2..9d631f0b 100644 --- a/Tests/ModelTests/StructureMapTests.swift +++ b/Tests/ModelTests/StructureMapTests.swift @@ -2,7 +2,7 @@ // StructureMapTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -34,20 +34,20 @@ class StructureMapTests: XCTestCase { func runStructureMap1(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.StructureMap { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "structuremap-example.json") - XCTAssertEqual(inst.group?[0].input?[0].mode, "source") + XCTAssertEqual(inst.group?[0].input?[0].mode, StructureMapInputMode(rawValue: "source")!) XCTAssertEqual(inst.group?[0].input?[0].name, "test") XCTAssertEqual(inst.group?[0].name, "Examples") XCTAssertEqual(inst.group?[0].rule?[0].name, "rule1") XCTAssertEqual(inst.group?[0].rule?[0].source?[0].context, "test") - XCTAssertEqual(inst.group?[0].rule?[0].source?[0].contextType, "variable") + XCTAssertEqual(inst.group?[0].rule?[0].source?[0].contextType, StructureMapContextType(rawValue: "variable")!) XCTAssertEqual(inst.group?[0].rule?[0].source?[0].element, "test") XCTAssertTrue(inst.group?[0].rule?[0].source?[0].required ?? false) XCTAssertEqual(inst.group?[0].rule?[0].source?[0].variable, "t") XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.name, "Example Map") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) XCTAssertEqual(inst.text?.div, "
[Put rendering here]
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/StructureMap/example") return inst diff --git a/Tests/ModelTests/SubscriptionTests.swift b/Tests/ModelTests/SubscriptionTests.swift index 0a70502d..e7783e7f 100644 --- a/Tests/ModelTests/SubscriptionTests.swift +++ b/Tests/ModelTests/SubscriptionTests.swift @@ -2,7 +2,7 @@ // SubscriptionTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -37,19 +37,19 @@ class SubscriptionTests: XCTestCase { XCTAssertEqual(inst.channel?.endpoint?.absoluteString, "https://biliwatch.com/customers/mount-auburn-miu/on-result") XCTAssertEqual(inst.channel?.header, "Authorization: Bearer secret-token-abc-123") XCTAssertEqual(inst.channel?.payload, "application/fhir+json") - XCTAssertEqual(inst.channel?.type, "rest-hook") - XCTAssertEqual(inst.contact?[0].system, "phone") + XCTAssertEqual(inst.channel?.type, SubscriptionChannelType(rawValue: "rest-hook")!) + XCTAssertEqual(inst.contact?[0].system, ContactPointSystem(rawValue: "phone")!) XCTAssertEqual(inst.contact?[0].value, "ext 4123") XCTAssertEqual(inst.criteria, "Observation?code=http://loinc.org|1975-2") XCTAssertEqual(inst.end?.description, "2021-01-01T00:00:00Z") XCTAssertEqual(inst.error, "Socket Error 10060 - can't connect to host") XCTAssertEqual(inst.id, "example-error") XCTAssertEqual(inst.reason, "Monitor new neonatal function") - XCTAssertEqual(inst.status, "error") + XCTAssertEqual(inst.status, SubscriptionStatus(rawValue: "error")!) XCTAssertEqual(inst.tag?[0].code, "bili-done") XCTAssertEqual(inst.tag?[0].system?.absoluteString, "http://example.org/fhir/cs/internal") XCTAssertEqual(inst.text?.div, "
[Put rendering here]
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -71,18 +71,18 @@ class SubscriptionTests: XCTestCase { XCTAssertEqual(inst.channel?.endpoint?.absoluteString, "https://biliwatch.com/customers/mount-auburn-miu/on-result") XCTAssertEqual(inst.channel?.header, "Authorization: Bearer secret-token-abc-123") XCTAssertEqual(inst.channel?.payload, "application/fhir+json") - XCTAssertEqual(inst.channel?.type, "rest-hook") - XCTAssertEqual(inst.contact?[0].system, "phone") + XCTAssertEqual(inst.channel?.type, SubscriptionChannelType(rawValue: "rest-hook")!) + XCTAssertEqual(inst.contact?[0].system, ContactPointSystem(rawValue: "phone")!) XCTAssertEqual(inst.contact?[0].value, "ext 4123") XCTAssertEqual(inst.criteria, "Observation?code=http://loinc.org|1975-2") XCTAssertEqual(inst.end?.description, "2021-01-01T00:00:00Z") XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.reason, "Monitor new neonatal function") - XCTAssertEqual(inst.status, "requested") + XCTAssertEqual(inst.status, SubscriptionStatus(rawValue: "requested")!) XCTAssertEqual(inst.tag?[0].code, "bili-done") XCTAssertEqual(inst.tag?[0].system?.absoluteString, "http://example.org/fhir/cs/internal") XCTAssertEqual(inst.text?.div, "
[Put rendering here]
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/SubstanceTests.swift b/Tests/ModelTests/SubstanceTests.swift index ac751d8a..914f8e29 100644 --- a/Tests/ModelTests/SubstanceTests.swift +++ b/Tests/ModelTests/SubstanceTests.swift @@ -2,7 +2,7 @@ // SubstanceTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -62,7 +62,7 @@ class SubstanceTests: XCTestCase { XCTAssertEqual(inst.ingredient?[1].quantity?.numerator?.unit, "mg") XCTAssertEqual(inst.ingredient?[1].quantity?.numerator?.value, NSDecimalNumber(string: "125")) XCTAssertEqual(inst.ingredient?[1].substanceReference?.reference, "#ingr2") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -85,7 +85,7 @@ class SubstanceTests: XCTestCase { XCTAssertEqual(inst.code?.coding?[0].display, "House dust allergen") XCTAssertEqual(inst.code?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.id, "f201") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -108,7 +108,7 @@ class SubstanceTests: XCTestCase { XCTAssertEqual(inst.code?.coding?[0].display, "Staphylococcus Aureus") XCTAssertEqual(inst.code?.coding?[0].system?.absoluteString, "http://snomed.info/sct") XCTAssertEqual(inst.id, "f202") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -136,7 +136,7 @@ class SubstanceTests: XCTestCase { XCTAssertEqual(inst.id, "f203") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://acme.org/identifiers/substances") XCTAssertEqual(inst.identifier?[0].value, "1234") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -172,7 +172,7 @@ class SubstanceTests: XCTestCase { XCTAssertEqual(inst.instance?[0].quantity?.system?.absoluteString, "http://unitsofmeasure.org") XCTAssertEqual(inst.instance?[0].quantity?.unit, "mL") XCTAssertEqual(inst.instance?[0].quantity?.value, NSDecimalNumber(string: "100")) - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -198,7 +198,7 @@ class SubstanceTests: XCTestCase { XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "http://acme.org/identifiers/substances") XCTAssertEqual(inst.identifier?[0].value, "1463") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/SupplyDeliveryTests.swift b/Tests/ModelTests/SupplyDeliveryTests.swift index 25cc999e..8aeef399 100644 --- a/Tests/ModelTests/SupplyDeliveryTests.swift +++ b/Tests/ModelTests/SupplyDeliveryTests.swift @@ -2,7 +2,7 @@ // SupplyDeliveryTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -36,7 +36,7 @@ class SupplyDeliveryTests: XCTestCase { XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.text?.div, "
[Put rendering here]
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/SupplyRequestTests.swift b/Tests/ModelTests/SupplyRequestTests.swift index 05a40a3e..3f889227 100644 --- a/Tests/ModelTests/SupplyRequestTests.swift +++ b/Tests/ModelTests/SupplyRequestTests.swift @@ -2,7 +2,7 @@ // SupplyRequestTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -36,7 +36,7 @@ class SupplyRequestTests: XCTestCase { XCTAssertEqual(inst.id, "example") XCTAssertEqual(inst.text?.div, "
[Put rendering here]
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/TaskTests.swift b/Tests/ModelTests/TaskTests.swift index 55d86337..56a9cf32 100644 --- a/Tests/ModelTests/TaskTests.swift +++ b/Tests/ModelTests/TaskTests.swift @@ -2,7 +2,7 @@ // TaskTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -44,8 +44,8 @@ class TaskTests: XCTestCase { XCTAssertEqual(inst.requester?.reference, "Patient/Keith") XCTAssertEqual(inst.stage?.coding?[0].code, "actionable") XCTAssertEqual(inst.stage?.coding?[0].system?.absoluteString, "http://hl7.org/fhir/task-stage") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, TaskStatus(rawValue: "draft")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/TestReportTests.swift b/Tests/ModelTests/TestReportTests.swift index b9e32e7c..18bc85a0 100644 --- a/Tests/ModelTests/TestReportTests.swift +++ b/Tests/ModelTests/TestReportTests.swift @@ -2,7 +2,7 @@ // TestReportTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -38,64 +38,64 @@ class TestReportTests: XCTestCase { XCTAssertEqual(inst.issued?.description, "2016-10-07T08:25:34-05:00") XCTAssertEqual(inst.name, "TestReport Example for TestScript Example") XCTAssertEqual(inst.participant?[0].display, "Crucible") - XCTAssertEqual(inst.participant?[0].type, "test-engine") + XCTAssertEqual(inst.participant?[0].type, TestReportParticipantType(rawValue: "test-engine")!) XCTAssertEqual(inst.participant?[0].uri?.absoluteString, "http://projectcrucible.org") XCTAssertEqual(inst.participant?[1].display, "HealthIntersections STU3") - XCTAssertEqual(inst.participant?[1].type, "server") + XCTAssertEqual(inst.participant?[1].type, TestReportParticipantType(rawValue: "server")!) XCTAssertEqual(inst.participant?[1].uri?.absoluteString, "http://fhir3.healthintersections.com.au/open") XCTAssertEqual(inst.score, NSDecimalNumber(string: "100.0")) XCTAssertEqual(inst.setup?.action?[0].operation?.detail?.absoluteString, "http://projectcrucible.org/permalink/1") XCTAssertEqual(inst.setup?.action?[0].operation?.message, "DELETE Patient") - XCTAssertEqual(inst.setup?.action?[0].operation?.result, "pass") + XCTAssertEqual(inst.setup?.action?[0].operation?.result, TestReportResultCodes(rawValue: "pass")!) XCTAssertEqual(inst.setup?.action?[1].assert?.detail, "http://projectcrucible.org/permalink/1") XCTAssertEqual(inst.setup?.action?[1].assert?.message, "HTTP 204") - XCTAssertEqual(inst.setup?.action?[1].assert?.result, "pass") + XCTAssertEqual(inst.setup?.action?[1].assert?.result, TestReportResultCodes(rawValue: "pass")!) XCTAssertEqual(inst.setup?.action?[2].operation?.detail?.absoluteString, "http://projectcrucible.org/permalink/1") XCTAssertEqual(inst.setup?.action?[2].operation?.message, "POST Patient/fixture-patient-create") - XCTAssertEqual(inst.setup?.action?[2].operation?.result, "pass") + XCTAssertEqual(inst.setup?.action?[2].operation?.result, TestReportResultCodes(rawValue: "pass")!) XCTAssertEqual(inst.setup?.action?[3].assert?.detail, "http://projectcrucible.org/permalink/1") XCTAssertEqual(inst.setup?.action?[3].assert?.message, "HTTP 201") - XCTAssertEqual(inst.setup?.action?[3].assert?.result, "pass") - XCTAssertEqual(inst.status, "complete") + XCTAssertEqual(inst.setup?.action?[3].assert?.result, TestReportResultCodes(rawValue: "pass")!) + XCTAssertEqual(inst.status, TestReportStatus(rawValue: "complete")!) XCTAssertEqual(inst.teardown?.action?[0].operation?.detail?.absoluteString, "http://projectcrucible.org/permalink/3") XCTAssertEqual(inst.teardown?.action?[0].operation?.message, "DELETE Patient/fixture-patient-create.") - XCTAssertEqual(inst.teardown?.action?[0].operation?.result, "pass") + XCTAssertEqual(inst.teardown?.action?[0].operation?.result, TestReportResultCodes(rawValue: "pass")!) XCTAssertEqual(inst.test?[0].action?[0].operation?.detail?.absoluteString, "http://projectcrucible.org/permalink/2") XCTAssertEqual(inst.test?[0].action?[0].operation?.message, "GET Patient/fixture-patient-create") - XCTAssertEqual(inst.test?[0].action?[0].operation?.result, "pass") + XCTAssertEqual(inst.test?[0].action?[0].operation?.result, TestReportResultCodes(rawValue: "pass")!) XCTAssertEqual(inst.test?[0].action?[1].assert?.detail, "http://projectcrucible.org/permalink/2") XCTAssertEqual(inst.test?[0].action?[1].assert?.message, "HTTP 200") - XCTAssertEqual(inst.test?[0].action?[1].assert?.result, "pass") + XCTAssertEqual(inst.test?[0].action?[1].assert?.result, TestReportResultCodes(rawValue: "pass")!) XCTAssertEqual(inst.test?[0].action?[2].assert?.detail, "http://projectcrucible.org/permalink/2") XCTAssertEqual(inst.test?[0].action?[2].assert?.message, "Last-Modified Present") - XCTAssertEqual(inst.test?[0].action?[2].assert?.result, "pass") + XCTAssertEqual(inst.test?[0].action?[2].assert?.result, TestReportResultCodes(rawValue: "pass")!) XCTAssertEqual(inst.test?[0].action?[3].assert?.detail, "http://projectcrucible.org/permalink/2") XCTAssertEqual(inst.test?[0].action?[3].assert?.message, "Response is Patient") - XCTAssertEqual(inst.test?[0].action?[3].assert?.result, "pass") + XCTAssertEqual(inst.test?[0].action?[3].assert?.result, TestReportResultCodes(rawValue: "pass")!) XCTAssertEqual(inst.test?[0].action?[4].assert?.detail, "http://projectcrucible.org/permalink/2") XCTAssertEqual(inst.test?[0].action?[4].assert?.message, "Response validates") - XCTAssertEqual(inst.test?[0].action?[4].assert?.result, "pass") + XCTAssertEqual(inst.test?[0].action?[4].assert?.result, TestReportResultCodes(rawValue: "pass")!) XCTAssertEqual(inst.test?[0].action?[5].assert?.detail, "http://projectcrucible.org/permalink/2") XCTAssertEqual(inst.test?[0].action?[5].assert?.message, "Patient.name.family 'Chalmers'") - XCTAssertEqual(inst.test?[0].action?[5].assert?.result, "pass") + XCTAssertEqual(inst.test?[0].action?[5].assert?.result, TestReportResultCodes(rawValue: "pass")!) XCTAssertEqual(inst.test?[0].action?[6].assert?.detail, "http://projectcrucible.org/permalink/2") XCTAssertEqual(inst.test?[0].action?[6].assert?.message, "Patient.name.given 'Peter'") - XCTAssertEqual(inst.test?[0].action?[6].assert?.result, "pass") + XCTAssertEqual(inst.test?[0].action?[6].assert?.result, TestReportResultCodes(rawValue: "pass")!) XCTAssertEqual(inst.test?[0].action?[7].assert?.detail, "http://projectcrucible.org/permalink/2") XCTAssertEqual(inst.test?[0].action?[7].assert?.message, "Patient.name.family 'Chalmers'") - XCTAssertEqual(inst.test?[0].action?[7].assert?.result, "pass") + XCTAssertEqual(inst.test?[0].action?[7].assert?.result, TestReportResultCodes(rawValue: "pass")!) XCTAssertEqual(inst.test?[0].action?[8].assert?.detail, "http://projectcrucible.org/permalink/2") XCTAssertEqual(inst.test?[0].action?[8].assert?.message, "Patient.name.family 'Chalmers'") - XCTAssertEqual(inst.test?[0].action?[8].assert?.result, "pass") + XCTAssertEqual(inst.test?[0].action?[8].assert?.result, TestReportResultCodes(rawValue: "pass")!) XCTAssertEqual(inst.test?[0].action?[9].assert?.detail, "http://projectcrucible.org/permalink/2") XCTAssertEqual(inst.test?[0].action?[9].assert?.message, "Patient expected values.") - XCTAssertEqual(inst.test?[0].action?[9].assert?.result, "pass") + XCTAssertEqual(inst.test?[0].action?[9].assert?.result, TestReportResultCodes(rawValue: "pass")!) XCTAssertEqual(inst.test?[0].description_fhir, "Read a Patient and validate response.") XCTAssertEqual(inst.test?[0].id, "01-ReadPatient") XCTAssertEqual(inst.test?[0].name, "Read Patient") XCTAssertEqual(inst.testScript?.reference, "TestScript/testscript-example") XCTAssertEqual(inst.tester, "HL7 Execution Engine") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ModelTests/TestScriptTests.swift b/Tests/ModelTests/TestScriptTests.swift index 515414e3..4fa2f67a 100644 --- a/Tests/ModelTests/TestScriptTests.swift +++ b/Tests/ModelTests/TestScriptTests.swift @@ -2,7 +2,7 @@ // TestScriptTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -35,8 +35,8 @@ class TestScriptTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "testscript-example-history.json") XCTAssertEqual(inst.contact?[0].name, "Support") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "email") - XCTAssertEqual(inst.contact?[0].telecom?[0].use, "work") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.contact?[0].telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "support@HL7.org") XCTAssertEqual(inst.copyright, "© HL7.org 2011+") XCTAssertEqual(inst.date?.description, "2016-09-26") @@ -69,7 +69,7 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.profile?[0].reference, "http://hl7.org/fhir/StructureDefinition/Bundle") XCTAssertEqual(inst.publisher, "HL7") XCTAssertEqual(inst.purpose, "Patient (Conditional) Create, Update, Delete and History (Instance) Operations") - XCTAssertEqual(inst.setup?.action?[0].operation?.accept, "json") + XCTAssertEqual(inst.setup?.action?[0].operation?.accept, ContentType(rawValue: "json")!) XCTAssertEqual(inst.setup?.action?[0].operation?.description_fhir, "Execute a delete operation to insure the patient does not exist on the server.") XCTAssertEqual(inst.setup?.action?[0].operation?.label, "SetupDeletePatient") XCTAssertEqual(inst.setup?.action?[0].operation?.params, "/${createResourceId}") @@ -77,11 +77,11 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.setup?.action?[0].operation?.type?.code, "delete") XCTAssertEqual(inst.setup?.action?[0].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.setup?.action?[1].assert?.description_fhir, "Confirm that the returned HTTP status is 200(OK) or 204(No Content).") - XCTAssertEqual(inst.setup?.action?[1].assert?.direction, "response") - XCTAssertEqual(inst.setup?.action?[1].assert?.operator_fhir, "in") + XCTAssertEqual(inst.setup?.action?[1].assert?.direction, AssertionDirectionType(rawValue: "response")!) + XCTAssertEqual(inst.setup?.action?[1].assert?.operator_fhir, AssertionOperatorType(rawValue: "in")!) XCTAssertEqual(inst.setup?.action?[1].assert?.responseCode, "200,204") - XCTAssertEqual(inst.setup?.action?[2].operation?.accept, "json") - XCTAssertEqual(inst.setup?.action?[2].operation?.contentType, "json") + XCTAssertEqual(inst.setup?.action?[2].operation?.accept, ContentType(rawValue: "json")!) + XCTAssertEqual(inst.setup?.action?[2].operation?.contentType, ContentType(rawValue: "json")!) XCTAssertEqual(inst.setup?.action?[2].operation?.description_fhir, "Create patient resource on test server using the contents of fixture-patient-create") XCTAssertEqual(inst.setup?.action?[2].operation?.label, "SetupCreatePatient") XCTAssertEqual(inst.setup?.action?[2].operation?.params, "/${createResourceId}") @@ -90,10 +90,10 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.setup?.action?[2].operation?.type?.code, "update") XCTAssertEqual(inst.setup?.action?[2].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.setup?.action?[3].assert?.description_fhir, "Confirm that the returned HTTP status is 201(Created).") - XCTAssertEqual(inst.setup?.action?[3].assert?.direction, "response") + XCTAssertEqual(inst.setup?.action?[3].assert?.direction, AssertionDirectionType(rawValue: "response")!) XCTAssertEqual(inst.setup?.action?[3].assert?.responseCode, "201") - XCTAssertEqual(inst.setup?.action?[4].operation?.accept, "json") - XCTAssertEqual(inst.setup?.action?[4].operation?.contentType, "json") + XCTAssertEqual(inst.setup?.action?[4].operation?.accept, ContentType(rawValue: "json")!) + XCTAssertEqual(inst.setup?.action?[4].operation?.contentType, ContentType(rawValue: "json")!) XCTAssertEqual(inst.setup?.action?[4].operation?.description_fhir, "Update patient resource on test server using the contents of fixture-patient-update") XCTAssertEqual(inst.setup?.action?[4].operation?.label, "SetupUpdatePatient") XCTAssertEqual(inst.setup?.action?[4].operation?.params, "/${createResourceId}") @@ -102,31 +102,31 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.setup?.action?[4].operation?.type?.code, "update") XCTAssertEqual(inst.setup?.action?[4].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.setup?.action?[5].assert?.description_fhir, "Confirm that the returned HTTP status is 200(OK).") - XCTAssertEqual(inst.setup?.action?[5].assert?.direction, "response") + XCTAssertEqual(inst.setup?.action?[5].assert?.direction, AssertionDirectionType(rawValue: "response")!) XCTAssertEqual(inst.setup?.action?[5].assert?.responseCode, "200") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.test?[0].action?[0].operation?.accept, "json") - XCTAssertEqual(inst.test?[0].action?[0].operation?.contentType, "json") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.test?[0].action?[0].operation?.accept, ContentType(rawValue: "json")!) + XCTAssertEqual(inst.test?[0].action?[0].operation?.contentType, ContentType(rawValue: "json")!) XCTAssertEqual(inst.test?[0].action?[0].operation?.description_fhir, "Get the Patient history on the test server using the id from fixture-patient-create.") XCTAssertEqual(inst.test?[0].action?[0].operation?.resource, "Patient") XCTAssertEqual(inst.test?[0].action?[0].operation?.targetId, "fixture-patient-create") XCTAssertEqual(inst.test?[0].action?[0].operation?.type?.code, "history") XCTAssertEqual(inst.test?[0].action?[0].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.test?[0].action?[1].assert?.description_fhir, "Confirm that the returned HTTP status is 200(OK).") - XCTAssertEqual(inst.test?[0].action?[1].assert?.direction, "response") - XCTAssertEqual(inst.test?[0].action?[1].assert?.response, "okay") + XCTAssertEqual(inst.test?[0].action?[1].assert?.direction, AssertionDirectionType(rawValue: "response")!) + XCTAssertEqual(inst.test?[0].action?[1].assert?.response, AssertionResponseTypes(rawValue: "okay")!) XCTAssertEqual(inst.test?[0].action?[2].assert?.description_fhir, "Confirm that the returned resource type is Bundle.") XCTAssertEqual(inst.test?[0].action?[2].assert?.resource, "Bundle") XCTAssertEqual(inst.test?[0].action?[3].assert?.description_fhir, "Confirm that the returned Bundle conforms to the base FHIR specification.") XCTAssertEqual(inst.test?[0].action?[3].assert?.validateProfileId, "bundle-profile") XCTAssertEqual(inst.test?[0].action?[4].assert?.description_fhir, "Confirm that the returned Bundle type equals 'history'.") - XCTAssertEqual(inst.test?[0].action?[4].assert?.operator_fhir, "equals") + XCTAssertEqual(inst.test?[0].action?[4].assert?.operator_fhir, AssertionOperatorType(rawValue: "equals")!) XCTAssertEqual(inst.test?[0].action?[4].assert?.path, "fhir:Bundle/fhir:type/@value") XCTAssertEqual(inst.test?[0].action?[4].assert?.value, "history") XCTAssertEqual(inst.test?[0].description_fhir, "Get the history for a known Patient and validate response.") XCTAssertEqual(inst.test?[0].id, "01-HistoryPatient") XCTAssertEqual(inst.test?[0].name, "History Patient") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/TestScript/testscript-example-history") XCTAssertEqual(inst.variable?[0].name, "createResourceId") XCTAssertEqual(inst.variable?[0].path, "Patient/id") @@ -151,8 +151,8 @@ class TestScriptTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "testscript-example-multisystem.json") XCTAssertEqual(inst.contact?[0].name, "Support") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "email") - XCTAssertEqual(inst.contact?[0].telecom?[0].use, "work") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.contact?[0].telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "support@HL7.org") XCTAssertEqual(inst.copyright, "© HL7.org 2011+") XCTAssertEqual(inst.date?.description, "2016-09-26") @@ -186,9 +186,9 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.origin?[0].profile?.code, "FHIR-Client") XCTAssertEqual(inst.publisher, "HL7") XCTAssertEqual(inst.purpose, "Patient Read Operation") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.test?[0].action?[0].operation?.accept, "xml") - XCTAssertEqual(inst.test?[0].action?[0].operation?.contentType, "xml") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.test?[0].action?[0].operation?.accept, ContentType(rawValue: "xml")!) + XCTAssertEqual(inst.test?[0].action?[0].operation?.contentType, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.test?[0].action?[0].operation?.description_fhir, "Read a Patient from the first destination test system and perform basic validation.") XCTAssertEqual(inst.test?[0].action?[0].operation?.destination, 1) XCTAssertEqual(inst.test?[0].action?[0].operation?.origin, 1) @@ -197,24 +197,24 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.test?[0].action?[0].operation?.type?.code, "read") XCTAssertEqual(inst.test?[0].action?[0].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.test?[0].action?[1].assert?.description_fhir, "Confirm that the client requested an Accept of xml.") - XCTAssertEqual(inst.test?[0].action?[1].assert?.direction, "request") + XCTAssertEqual(inst.test?[0].action?[1].assert?.direction, AssertionDirectionType(rawValue: "request")!) XCTAssertEqual(inst.test?[0].action?[1].assert?.headerField, "Accept") - XCTAssertEqual(inst.test?[0].action?[1].assert?.operator_fhir, "contains") + XCTAssertEqual(inst.test?[0].action?[1].assert?.operator_fhir, AssertionOperatorType(rawValue: "contains")!) XCTAssertEqual(inst.test?[0].action?[1].assert?.value, "xml") XCTAssertEqual(inst.test?[0].action?[2].assert?.description_fhir, "Confirm that the returned HTTP status is 200(OK).") - XCTAssertEqual(inst.test?[0].action?[2].assert?.direction, "response") - XCTAssertEqual(inst.test?[0].action?[2].assert?.response, "okay") - XCTAssertEqual(inst.test?[0].action?[3].assert?.contentType, "xml") + XCTAssertEqual(inst.test?[0].action?[2].assert?.direction, AssertionDirectionType(rawValue: "response")!) + XCTAssertEqual(inst.test?[0].action?[2].assert?.response, AssertionResponseTypes(rawValue: "okay")!) + XCTAssertEqual(inst.test?[0].action?[3].assert?.contentType, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.test?[0].action?[3].assert?.description_fhir, "Confirm that the returned format is XML.") - XCTAssertEqual(inst.test?[0].action?[3].assert?.direction, "response") + XCTAssertEqual(inst.test?[0].action?[3].assert?.direction, AssertionDirectionType(rawValue: "response")!) XCTAssertEqual(inst.test?[0].action?[4].assert?.description_fhir, "Confirm that the returned resource type is Patient.") - XCTAssertEqual(inst.test?[0].action?[4].assert?.direction, "response") + XCTAssertEqual(inst.test?[0].action?[4].assert?.direction, AssertionDirectionType(rawValue: "response")!) XCTAssertEqual(inst.test?[0].action?[4].assert?.resource, "Patient") XCTAssertEqual(inst.test?[0].description_fhir, "Read a Patient from the first destination test system using the user defined dynamic variable ${Dest1PatientResourceId}. Perform basic validation.") XCTAssertEqual(inst.test?[0].id, "01-ReadPatient-Destination1") XCTAssertEqual(inst.test?[0].name, "ReadPatient-Destination1") - XCTAssertEqual(inst.test?[1].action?[0].operation?.accept, "xml") - XCTAssertEqual(inst.test?[1].action?[0].operation?.contentType, "xml") + XCTAssertEqual(inst.test?[1].action?[0].operation?.accept, ContentType(rawValue: "xml")!) + XCTAssertEqual(inst.test?[1].action?[0].operation?.contentType, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.test?[1].action?[0].operation?.description_fhir, "Read a Patient from the second destination test system and perform basic validation.") XCTAssertEqual(inst.test?[1].action?[0].operation?.destination, 2) XCTAssertEqual(inst.test?[1].action?[0].operation?.origin, 1) @@ -223,23 +223,23 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.test?[1].action?[0].operation?.type?.code, "read") XCTAssertEqual(inst.test?[1].action?[0].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.test?[1].action?[1].assert?.description_fhir, "Confirm that the client requested an Accept of xml.") - XCTAssertEqual(inst.test?[1].action?[1].assert?.direction, "request") + XCTAssertEqual(inst.test?[1].action?[1].assert?.direction, AssertionDirectionType(rawValue: "request")!) XCTAssertEqual(inst.test?[1].action?[1].assert?.headerField, "Accept") - XCTAssertEqual(inst.test?[1].action?[1].assert?.operator_fhir, "contains") + XCTAssertEqual(inst.test?[1].action?[1].assert?.operator_fhir, AssertionOperatorType(rawValue: "contains")!) XCTAssertEqual(inst.test?[1].action?[1].assert?.value, "xml") XCTAssertEqual(inst.test?[1].action?[2].assert?.description_fhir, "Confirm that the returned HTTP status is 200(OK).") - XCTAssertEqual(inst.test?[1].action?[2].assert?.direction, "response") - XCTAssertEqual(inst.test?[1].action?[2].assert?.response, "okay") - XCTAssertEqual(inst.test?[1].action?[3].assert?.contentType, "xml") + XCTAssertEqual(inst.test?[1].action?[2].assert?.direction, AssertionDirectionType(rawValue: "response")!) + XCTAssertEqual(inst.test?[1].action?[2].assert?.response, AssertionResponseTypes(rawValue: "okay")!) + XCTAssertEqual(inst.test?[1].action?[3].assert?.contentType, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.test?[1].action?[3].assert?.description_fhir, "Confirm that the returned format is XML.") - XCTAssertEqual(inst.test?[1].action?[3].assert?.direction, "response") + XCTAssertEqual(inst.test?[1].action?[3].assert?.direction, AssertionDirectionType(rawValue: "response")!) XCTAssertEqual(inst.test?[1].action?[4].assert?.description_fhir, "Confirm that the returned resource type is Patient.") - XCTAssertEqual(inst.test?[1].action?[4].assert?.direction, "response") + XCTAssertEqual(inst.test?[1].action?[4].assert?.direction, AssertionDirectionType(rawValue: "response")!) XCTAssertEqual(inst.test?[1].action?[4].assert?.resource, "Patient") XCTAssertEqual(inst.test?[1].description_fhir, "Read a Patient from the second destination test system using the user defined dynamic variable ${Dest2PatientResourceId}. Perform basic validation.") XCTAssertEqual(inst.test?[1].id, "02-ReadPatient-Destination2") XCTAssertEqual(inst.test?[1].name, "ReadPatient-Destination2") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/TestScript/testscript-example-multisystem") XCTAssertEqual(inst.variable?[0].defaultValue, "example") XCTAssertEqual(inst.variable?[0].name, "Dest1PatientResourceId") @@ -265,8 +265,8 @@ class TestScriptTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "testscript-example-readtest.json") XCTAssertEqual(inst.contact?[0].name, "Support") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "email") - XCTAssertEqual(inst.contact?[0].telecom?[0].use, "work") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.contact?[0].telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "support@HL7.org") XCTAssertEqual(inst.copyright, "© HL7.org 2011+") XCTAssertEqual(inst.date?.description, "2016-09-26") @@ -288,20 +288,20 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.profile?[0].reference, "http://hl7.org/fhir/StructureDefinition/Patient") XCTAssertEqual(inst.publisher, "HL7") XCTAssertEqual(inst.purpose, "Patient Read Operation") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.test?[0].action?[0].operation?.accept, "xml") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.test?[0].action?[0].operation?.accept, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.test?[0].action?[0].operation?.description_fhir, "Read the known Patient resource on the destination test system using the user defined dynamic variable ${KnownPatientResourceId}.") XCTAssertEqual(inst.test?[0].action?[0].operation?.params, "/${KnownPatientResourceId}") XCTAssertEqual(inst.test?[0].action?[0].operation?.resource, "Patient") XCTAssertEqual(inst.test?[0].action?[0].operation?.type?.code, "read") XCTAssertEqual(inst.test?[0].action?[0].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.test?[0].action?[1].assert?.description_fhir, "Confirm that the returned HTTP status is 200(OK).") - XCTAssertEqual(inst.test?[0].action?[1].assert?.response, "okay") - XCTAssertEqual(inst.test?[0].action?[2].assert?.contentType, "xml") + XCTAssertEqual(inst.test?[0].action?[1].assert?.response, AssertionResponseTypes(rawValue: "okay")!) + XCTAssertEqual(inst.test?[0].action?[2].assert?.contentType, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.test?[0].action?[2].assert?.description_fhir, "Confirm that the returned format is XML.") XCTAssertEqual(inst.test?[0].action?[3].assert?.description_fhir, "Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning.") XCTAssertEqual(inst.test?[0].action?[3].assert?.headerField, "Last-Modified") - XCTAssertEqual(inst.test?[0].action?[3].assert?.operator_fhir, "notEmpty") + XCTAssertEqual(inst.test?[0].action?[3].assert?.operator_fhir, AssertionOperatorType(rawValue: "notEmpty")!) XCTAssertTrue(inst.test?[0].action?[3].assert?.warningOnly ?? false) XCTAssertEqual(inst.test?[0].action?[4].assert?.description_fhir, "Confirm that the returned resource type is Patient.") XCTAssertEqual(inst.test?[0].action?[4].assert?.resource, "Patient") @@ -310,39 +310,39 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.test?[0].description_fhir, "Read a known Patient and validate response.") XCTAssertEqual(inst.test?[0].id, "R001") XCTAssertEqual(inst.test?[0].name, "Sprinkler Read Test R001") - XCTAssertEqual(inst.test?[1].action?[0].operation?.accept, "xml") + XCTAssertEqual(inst.test?[1].action?[0].operation?.accept, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.test?[1].action?[0].operation?.params, "/1") XCTAssertEqual(inst.test?[1].action?[0].operation?.resource, "Patient") XCTAssertEqual(inst.test?[1].action?[0].operation?.type?.code, "read") XCTAssertEqual(inst.test?[1].action?[0].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.test?[1].action?[1].assert?.description_fhir, "Confirm that the returned HTTP status is 404(Not Found).") - XCTAssertEqual(inst.test?[1].action?[1].assert?.response, "notFound") + XCTAssertEqual(inst.test?[1].action?[1].assert?.response, AssertionResponseTypes(rawValue: "notFound")!) XCTAssertEqual(inst.test?[1].description_fhir, "Read an unknown Resource Type and validate response.") XCTAssertEqual(inst.test?[1].id, "R002") XCTAssertEqual(inst.test?[1].name, "Sprinkler Read Test R002") - XCTAssertEqual(inst.test?[2].action?[0].operation?.accept, "xml") + XCTAssertEqual(inst.test?[2].action?[0].operation?.accept, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.test?[2].action?[0].operation?.description_fhir, "Attempt to read the non-existing Patient resource on the destination test system using the user defined dynamic variable ${NonExistsPatientResourceId}.") XCTAssertEqual(inst.test?[2].action?[0].operation?.params, "/${NonExistsPatientResourceId}") XCTAssertEqual(inst.test?[2].action?[0].operation?.resource, "Patient") XCTAssertEqual(inst.test?[2].action?[0].operation?.type?.code, "read") XCTAssertEqual(inst.test?[2].action?[0].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.test?[2].action?[1].assert?.description_fhir, "Confirm that the returned HTTP status is 404(Not Found).") - XCTAssertEqual(inst.test?[2].action?[1].assert?.response, "notFound") + XCTAssertEqual(inst.test?[2].action?[1].assert?.response, AssertionResponseTypes(rawValue: "notFound")!) XCTAssertEqual(inst.test?[2].description_fhir, "Read a known, non-existing Patient and validate response.") XCTAssertEqual(inst.test?[2].id, "R003") XCTAssertEqual(inst.test?[2].name, "Sprinkler Read Test R003") - XCTAssertEqual(inst.test?[3].action?[0].operation?.accept, "xml") + XCTAssertEqual(inst.test?[3].action?[0].operation?.accept, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.test?[3].action?[0].operation?.description_fhir, "Attempt to read a Patient resource on the destination test system using known bad formatted resource id.") XCTAssertEqual(inst.test?[3].action?[0].operation?.params, "/ID-may-not-contain-CAPITALS") XCTAssertEqual(inst.test?[3].action?[0].operation?.resource, "Patient") XCTAssertEqual(inst.test?[3].action?[0].operation?.type?.code, "read") XCTAssertEqual(inst.test?[3].action?[0].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.test?[3].action?[1].assert?.description_fhir, "Confirm that the returned HTTP status is 400(Bad Request).") - XCTAssertEqual(inst.test?[3].action?[1].assert?.response, "bad") + XCTAssertEqual(inst.test?[3].action?[1].assert?.response, AssertionResponseTypes(rawValue: "bad")!) XCTAssertEqual(inst.test?[3].description_fhir, "Read a Patient using a known bad formatted resource id and validate response.") XCTAssertEqual(inst.test?[3].id, "R004") XCTAssertEqual(inst.test?[3].name, "Sprinkler Read Test R004") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/TestScript/testscript-example-readtest") XCTAssertEqual(inst.variable?[0].defaultValue, "example") XCTAssertEqual(inst.variable?[0].name, "KnownPatientResourceId") @@ -368,8 +368,8 @@ class TestScriptTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "testscript-example-rule.json") XCTAssertEqual(inst.contact?[0].name, "Support") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "email") - XCTAssertEqual(inst.contact?[0].telecom?[0].use, "work") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.contact?[0].telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "support@HL7.org") XCTAssertEqual(inst.copyright, "© HL7.org 2011+") XCTAssertEqual(inst.date?.description, "2016-09-26") @@ -414,7 +414,7 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.ruleset?[0].rule?[1].param?[0].name, "expectedStatusCode") XCTAssertEqual(inst.ruleset?[0].rule?[1].param?[0].value, "200") XCTAssertEqual(inst.ruleset?[0].rule?[1].ruleId, "RuleResponseStatusCode") - XCTAssertEqual(inst.setup?.action?[0].operation?.accept, "json") + XCTAssertEqual(inst.setup?.action?[0].operation?.accept, ContentType(rawValue: "json")!) XCTAssertEqual(inst.setup?.action?[0].operation?.description_fhir, "Execute a delete operation to insure the patient does not exist on the server.") XCTAssertEqual(inst.setup?.action?[0].operation?.label, "SetupDeletePatient") XCTAssertEqual(inst.setup?.action?[0].operation?.params, "/${createResourceId}") @@ -422,11 +422,11 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.setup?.action?[0].operation?.type?.code, "delete") XCTAssertEqual(inst.setup?.action?[0].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.setup?.action?[1].assert?.description_fhir, "Confirm that the returned HTTP status is 200(OK) or 204(No Content).") - XCTAssertEqual(inst.setup?.action?[1].assert?.direction, "response") - XCTAssertEqual(inst.setup?.action?[1].assert?.operator_fhir, "in") + XCTAssertEqual(inst.setup?.action?[1].assert?.direction, AssertionDirectionType(rawValue: "response")!) + XCTAssertEqual(inst.setup?.action?[1].assert?.operator_fhir, AssertionOperatorType(rawValue: "in")!) XCTAssertEqual(inst.setup?.action?[1].assert?.responseCode, "200,204") - XCTAssertEqual(inst.setup?.action?[2].operation?.accept, "json") - XCTAssertEqual(inst.setup?.action?[2].operation?.contentType, "json") + XCTAssertEqual(inst.setup?.action?[2].operation?.accept, ContentType(rawValue: "json")!) + XCTAssertEqual(inst.setup?.action?[2].operation?.contentType, ContentType(rawValue: "json")!) XCTAssertEqual(inst.setup?.action?[2].operation?.description_fhir, "Create patient resource on test server using the contents of fixture-patient-create") XCTAssertEqual(inst.setup?.action?[2].operation?.label, "SetupCreatePatient") XCTAssertEqual(inst.setup?.action?[2].operation?.params, "/${createResourceId}") @@ -435,12 +435,12 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.setup?.action?[2].operation?.type?.code, "update") XCTAssertEqual(inst.setup?.action?[2].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.setup?.action?[3].assert?.description_fhir, "Confirm that the returned HTTP status is 201(Created).") - XCTAssertEqual(inst.setup?.action?[3].assert?.direction, "response") + XCTAssertEqual(inst.setup?.action?[3].assert?.direction, AssertionDirectionType(rawValue: "response")!) XCTAssertEqual(inst.setup?.action?[3].assert?.label, "Setup-RuleCreateOK") XCTAssertEqual(inst.setup?.action?[3].assert?.rule?.param?[0].name, "expectedStatusCode") XCTAssertEqual(inst.setup?.action?[3].assert?.rule?.param?[0].value, "201") XCTAssertEqual(inst.setup?.action?[3].assert?.rule?.ruleId, "rule-responseStatusCode") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) XCTAssertEqual(inst.test?[0].action?[0].operation?.description_fhir, "Read the patient resource on the test server using the id from fixture-patient-create. Prevent URL encoding of the request.") XCTAssertFalse(inst.test?[0].action?[0].operation?.encodeRequestUrl ?? true) XCTAssertEqual(inst.test?[0].action?[0].operation?.resource, "Patient") @@ -457,27 +457,27 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.test?[0].action?[2].assert?.ruleset?.rule?[0].ruleId, "RuleResponseContentType") XCTAssertEqual(inst.test?[0].action?[2].assert?.ruleset?.rulesetId, "ruleset-responseResourcePatient") XCTAssertEqual(inst.test?[0].action?[3].assert?.description_fhir, "Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning.") - XCTAssertEqual(inst.test?[0].action?[3].assert?.direction, "response") + XCTAssertEqual(inst.test?[0].action?[3].assert?.direction, AssertionDirectionType(rawValue: "response")!) XCTAssertEqual(inst.test?[0].action?[3].assert?.headerField, "Last-Modified") - XCTAssertEqual(inst.test?[0].action?[3].assert?.operator_fhir, "notEmpty") + XCTAssertEqual(inst.test?[0].action?[3].assert?.operator_fhir, AssertionOperatorType(rawValue: "notEmpty")!) XCTAssertTrue(inst.test?[0].action?[3].assert?.warningOnly ?? false) XCTAssertEqual(inst.test?[0].action?[4].assert?.description_fhir, "Confirm that the returned resource type is Patient.") XCTAssertEqual(inst.test?[0].action?[4].assert?.resource, "Patient") XCTAssertEqual(inst.test?[0].action?[5].assert?.description_fhir, "Confirm that the returned Patient conforms to the base FHIR specification.") XCTAssertEqual(inst.test?[0].action?[5].assert?.validateProfileId, "patient-profile") XCTAssertEqual(inst.test?[0].action?[6].assert?.description_fhir, "Confirm that the returned Patient contains the expected family name 'Chalmers'. Uses explicit sourceId reference to read responseId fixture.") - XCTAssertEqual(inst.test?[0].action?[6].assert?.operator_fhir, "equals") + XCTAssertEqual(inst.test?[0].action?[6].assert?.operator_fhir, AssertionOperatorType(rawValue: "equals")!) XCTAssertEqual(inst.test?[0].action?[6].assert?.path, "fhir:Patient/fhir:name/fhir:family/@value") XCTAssertEqual(inst.test?[0].action?[6].assert?.sourceId, "fixture-patient-read") XCTAssertEqual(inst.test?[0].action?[6].assert?.value, "Chalmers") XCTAssertEqual(inst.test?[0].action?[7].assert?.description_fhir, "Confirm that the returned Patient contains the expected given name 'Peter'. Uses explicit sourceId reference to read responseId fixture.") - XCTAssertEqual(inst.test?[0].action?[7].assert?.operator_fhir, "equals") + XCTAssertEqual(inst.test?[0].action?[7].assert?.operator_fhir, AssertionOperatorType(rawValue: "equals")!) XCTAssertEqual(inst.test?[0].action?[7].assert?.path, "fhir:Patient/fhir:name/fhir:given/@value") XCTAssertEqual(inst.test?[0].action?[7].assert?.sourceId, "fixture-patient-read") XCTAssertEqual(inst.test?[0].action?[7].assert?.value, "Peter") XCTAssertEqual(inst.test?[0].action?[8].assert?.compareToSourceId, "fixture-patient-create") XCTAssertEqual(inst.test?[0].action?[8].assert?.compareToSourcePath, "fhir:Patient/fhir:name/fhir:family/@value") - XCTAssertEqual(inst.test?[0].action?[8].assert?.operator_fhir, "equals") + XCTAssertEqual(inst.test?[0].action?[8].assert?.operator_fhir, AssertionOperatorType(rawValue: "equals")!) XCTAssertEqual(inst.test?[0].action?[8].assert?.path, "fhir:Patient/fhir:name/fhir:family/@value") XCTAssertEqual(inst.test?[0].action?[9].assert?.compareToSourceId, "fixture-patient-create") XCTAssertEqual(inst.test?[0].action?[9].assert?.compareToSourcePath, "fhir:Patient/fhir:name/fhir:given/@value") @@ -486,7 +486,7 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.test?[0].description_fhir, "Read a patient and validate response.") XCTAssertEqual(inst.test?[0].id, "01-ReadPatient") XCTAssertEqual(inst.test?[0].name, "Read Patient") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/TestScript/testscript-example-rule") XCTAssertEqual(inst.variable?[0].name, "createResourceId") XCTAssertEqual(inst.variable?[0].path, "Patient/id") @@ -511,8 +511,8 @@ class TestScriptTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "testscript-example-search.json") XCTAssertEqual(inst.contact?[0].name, "Support") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "email") - XCTAssertEqual(inst.contact?[0].telecom?[0].use, "work") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.contact?[0].telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "support@HL7.org") XCTAssertEqual(inst.copyright, "© HL7.org 2011+") XCTAssertEqual(inst.date?.description, "2016-09-26") @@ -537,9 +537,9 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.profile?[0].reference, "http://hl7.org/fhir/StructureDefinition/Bundle") XCTAssertEqual(inst.publisher, "HL7") XCTAssertEqual(inst.purpose, "Patient Search Operation") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.test?[0].action?[0].operation?.accept, "xml") - XCTAssertEqual(inst.test?[0].action?[0].operation?.contentType, "xml") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.test?[0].action?[0].operation?.accept, ContentType(rawValue: "xml")!) + XCTAssertEqual(inst.test?[0].action?[0].operation?.contentType, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.test?[0].action?[0].operation?.description_fhir, "Create a Patient resource and capture the returned HTTP Header Location.") XCTAssertEqual(inst.test?[0].action?[0].operation?.resource, "Patient") XCTAssertEqual(inst.test?[0].action?[0].operation?.responseId, "PatientCreateResponse") @@ -547,52 +547,54 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.test?[0].action?[0].operation?.type?.code, "create") XCTAssertEqual(inst.test?[0].action?[0].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.test?[0].action?[1].assert?.description_fhir, "Confirm that the returned HTTP status is 201(Created).") - XCTAssertEqual(inst.test?[0].action?[1].assert?.response, "created") + XCTAssertEqual(inst.test?[0].action?[1].assert?.response, AssertionResponseTypes(rawValue: "created")!) XCTAssertEqual(inst.test?[0].action?[2].assert?.description_fhir, "Confirm that the returned HTTP Header Location is present.") - XCTAssertEqual(inst.test?[0].action?[2].assert?.direction, "response") + XCTAssertEqual(inst.test?[0].action?[2].assert?.direction, AssertionDirectionType(rawValue: "response")!) XCTAssertEqual(inst.test?[0].action?[2].assert?.headerField, "Location") - XCTAssertEqual(inst.test?[0].action?[2].assert?.operator_fhir, "notEmpty") - XCTAssertEqual(inst.test?[0].action?[3].operation?.accept, "xml") + XCTAssertEqual(inst.test?[0].action?[2].assert?.operator_fhir, AssertionOperatorType(rawValue: "notEmpty")!) + XCTAssertEqual(inst.test?[0].action?[3].operation?.accept, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.test?[0].action?[3].operation?.description_fhir, "Read the created Patient using the captured Location URL value.") XCTAssertEqual(inst.test?[0].action?[3].operation?.type?.code, "read") XCTAssertEqual(inst.test?[0].action?[3].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.test?[0].action?[3].operation?.url, "${PatientCreateLocation}") XCTAssertEqual(inst.test?[0].action?[4].assert?.description_fhir, "Confirm that the returned HTTP status is 200(OK).") - XCTAssertEqual(inst.test?[0].action?[4].assert?.response, "okay") + XCTAssertEqual(inst.test?[0].action?[4].assert?.response, AssertionResponseTypes(rawValue: "okay")!) XCTAssertEqual(inst.test?[0].action?[5].assert?.description_fhir, "Confirm that the returned resource type is Patient.") XCTAssertEqual(inst.test?[0].action?[5].assert?.resource, "Patient") XCTAssertEqual(inst.test?[0].description_fhir, "Create a Patient resource and capture the returned HTTP Header Location. Then search for (read) that Patient using the Location URL value and validate the response.") XCTAssertEqual(inst.test?[0].id, "01-PatientCreateSearch") XCTAssertEqual(inst.test?[0].name, "Patient Create Search") - XCTAssertEqual(inst.test?[1].action?[0].operation?.accept, "xml") + XCTAssertEqual(inst.test?[1].action?[0].operation?.accept, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.test?[1].action?[0].operation?.description_fhir, "Search for Patient resources on the destination test system.") XCTAssertEqual(inst.test?[1].action?[0].operation?.params, "?family=${PatientSearchFamilyName}&given=${PatientSearchGivenName}") XCTAssertEqual(inst.test?[1].action?[0].operation?.resource, "Patient") XCTAssertEqual(inst.test?[1].action?[0].operation?.type?.code, "search") XCTAssertEqual(inst.test?[1].action?[0].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.test?[1].action?[1].assert?.description_fhir, "Confirm that the returned HTTP status is 200(OK).") - XCTAssertEqual(inst.test?[1].action?[1].assert?.response, "okay") - XCTAssertEqual(inst.test?[1].action?[2].assert?.contentType, "xml") + XCTAssertEqual(inst.test?[1].action?[1].assert?.response, AssertionResponseTypes(rawValue: "okay")!) + XCTAssertEqual(inst.test?[1].action?[2].assert?.contentType, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.test?[1].action?[2].assert?.description_fhir, "Confirm that the returned format is XML.") XCTAssertEqual(inst.test?[1].action?[3].assert?.description_fhir, "Confirm that the returned resource type is Bundle.") XCTAssertEqual(inst.test?[1].action?[3].assert?.resource, "Bundle") XCTAssertEqual(inst.test?[1].action?[4].assert?.description_fhir, "Confirm that the returned Bundle conforms to the base FHIR specification.") XCTAssertEqual(inst.test?[1].action?[4].assert?.validateProfileId, "bundle-profile") XCTAssertEqual(inst.test?[1].action?[5].assert?.description_fhir, "Confirm that the returned Bundle type equals 'searchset'.") - XCTAssertEqual(inst.test?[1].action?[5].assert?.operator_fhir, "equals") + XCTAssertEqual(inst.test?[1].action?[5].assert?.operator_fhir, AssertionOperatorType(rawValue: "equals")!) XCTAssertEqual(inst.test?[1].action?[5].assert?.path, "fhir:Bundle/fhir:type/@value") XCTAssertEqual(inst.test?[1].action?[5].assert?.value, "searchset") XCTAssertEqual(inst.test?[1].description_fhir, "Search for Patient resources using the user defined dynamic variables ${PatientSearchFamilyName} and ${PatientSearchGivenName} and validate response.") XCTAssertEqual(inst.test?[1].id, "02-PatientSearchDynamic") XCTAssertEqual(inst.test?[1].name, "Patient Search Dynamic") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/TestScript/testscript-example-search") XCTAssertEqual(inst.variable?[0].headerField, "Location") XCTAssertEqual(inst.variable?[0].name, "PatientCreateLocation") XCTAssertEqual(inst.variable?[0].sourceId, "PatientCreateResponse") - XCTAssertEqual(inst.variable?[1].defaultValue, "Chalmers") + XCTAssertEqual(inst.variable?[1].description_fhir, "Enter patient search criteria for a known family name on the target system") + XCTAssertEqual(inst.variable?[1].hint, "[Family name]") XCTAssertEqual(inst.variable?[1].name, "PatientSearchFamilyName") - XCTAssertEqual(inst.variable?[2].defaultValue, "Peter") + XCTAssertEqual(inst.variable?[2].description_fhir, "Enter patient search criteria for a known given name on the target system") + XCTAssertEqual(inst.variable?[2].hint, "[Given name]") XCTAssertEqual(inst.variable?[2].name, "PatientSearchGivenName") XCTAssertEqual(inst.version, "1.0") @@ -614,8 +616,8 @@ class TestScriptTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "testscript-example-update.json") XCTAssertEqual(inst.contact?[0].name, "Support") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "email") - XCTAssertEqual(inst.contact?[0].telecom?[0].use, "work") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.contact?[0].telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "support@HL7.org") XCTAssertEqual(inst.copyright, "© HL7.org 2011+") XCTAssertEqual(inst.date?.description, "2016-09-26") @@ -648,7 +650,7 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.profile?[0].reference, "http://hl7.org/fhir/StructureDefinition/Patient") XCTAssertEqual(inst.publisher, "HL7") XCTAssertEqual(inst.purpose, "Patient (Conditional) Create, Update, Delete Operations") - XCTAssertEqual(inst.setup?.action?[0].operation?.accept, "xml") + XCTAssertEqual(inst.setup?.action?[0].operation?.accept, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.setup?.action?[0].operation?.description_fhir, "Execute a delete operation to insure the patient does not exist on the server.") XCTAssertEqual(inst.setup?.action?[0].operation?.label, "SetupDeletePatient") XCTAssertEqual(inst.setup?.action?[0].operation?.params, "/${createResourceId}") @@ -656,11 +658,11 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.setup?.action?[0].operation?.type?.code, "delete") XCTAssertEqual(inst.setup?.action?[0].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.setup?.action?[1].assert?.description_fhir, "Confirm that the returned HTTP status is 200(OK) or 204(No Content).") - XCTAssertEqual(inst.setup?.action?[1].assert?.direction, "response") - XCTAssertEqual(inst.setup?.action?[1].assert?.operator_fhir, "in") + XCTAssertEqual(inst.setup?.action?[1].assert?.direction, AssertionDirectionType(rawValue: "response")!) + XCTAssertEqual(inst.setup?.action?[1].assert?.operator_fhir, AssertionOperatorType(rawValue: "in")!) XCTAssertEqual(inst.setup?.action?[1].assert?.responseCode, "200,204") - XCTAssertEqual(inst.setup?.action?[2].operation?.accept, "xml") - XCTAssertEqual(inst.setup?.action?[2].operation?.contentType, "xml") + XCTAssertEqual(inst.setup?.action?[2].operation?.accept, ContentType(rawValue: "xml")!) + XCTAssertEqual(inst.setup?.action?[2].operation?.contentType, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.setup?.action?[2].operation?.description_fhir, "Create patient resource on test server using the contents of fixture-patient-create") XCTAssertEqual(inst.setup?.action?[2].operation?.label, "SetupCreatePatient") XCTAssertEqual(inst.setup?.action?[2].operation?.params, "/${createResourceId}") @@ -669,11 +671,11 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.setup?.action?[2].operation?.type?.code, "update") XCTAssertEqual(inst.setup?.action?[2].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.setup?.action?[3].assert?.description_fhir, "Confirm that the returned HTTP status is 201(Created).") - XCTAssertEqual(inst.setup?.action?[3].assert?.direction, "response") + XCTAssertEqual(inst.setup?.action?[3].assert?.direction, AssertionDirectionType(rawValue: "response")!) XCTAssertEqual(inst.setup?.action?[3].assert?.responseCode, "201") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.test?[0].action?[0].operation?.accept, "xml") - XCTAssertEqual(inst.test?[0].action?[0].operation?.contentType, "xml") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.test?[0].action?[0].operation?.accept, ContentType(rawValue: "xml")!) + XCTAssertEqual(inst.test?[0].action?[0].operation?.contentType, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.test?[0].action?[0].operation?.description_fhir, "Update patient resource on test server using the contents of fixture-patient-update") XCTAssertEqual(inst.test?[0].action?[0].operation?.label, "SetupUpdatePatient") XCTAssertEqual(inst.test?[0].action?[0].operation?.params, "/${createResourceId}") @@ -682,17 +684,17 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.test?[0].action?[0].operation?.type?.code, "update") XCTAssertEqual(inst.test?[0].action?[0].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.test?[0].action?[1].assert?.description_fhir, "Confirm that the returned HTTP status is 200(OK).") - XCTAssertEqual(inst.test?[0].action?[1].assert?.response, "okay") - XCTAssertEqual(inst.test?[0].action?[2].assert?.contentType, "xml") + XCTAssertEqual(inst.test?[0].action?[1].assert?.response, AssertionResponseTypes(rawValue: "okay")!) + XCTAssertEqual(inst.test?[0].action?[2].assert?.contentType, ContentType(rawValue: "xml")!) XCTAssertEqual(inst.test?[0].action?[2].assert?.description_fhir, "Confirm that the returned format is XML.") XCTAssertEqual(inst.test?[0].action?[3].assert?.description_fhir, "Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning.") XCTAssertEqual(inst.test?[0].action?[3].assert?.headerField, "Last-Modified") - XCTAssertEqual(inst.test?[0].action?[3].assert?.operator_fhir, "notEmpty") + XCTAssertEqual(inst.test?[0].action?[3].assert?.operator_fhir, AssertionOperatorType(rawValue: "notEmpty")!) XCTAssertTrue(inst.test?[0].action?[3].assert?.warningOnly ?? false) XCTAssertEqual(inst.test?[0].description_fhir, "Update a Patient and validate response.") XCTAssertEqual(inst.test?[0].id, "01-UpdatePatient") XCTAssertEqual(inst.test?[0].name, "Update Patient") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/TestScript/testscript-example-update") XCTAssertEqual(inst.variable?[0].name, "createResourceId") XCTAssertEqual(inst.variable?[0].path, "Patient/id") @@ -717,8 +719,8 @@ class TestScriptTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "testscript-example.json") XCTAssertEqual(inst.contact?[0].name, "Support") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "email") - XCTAssertEqual(inst.contact?[0].telecom?[0].use, "work") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "email")!) + XCTAssertEqual(inst.contact?[0].telecom?[0].use, ContactPointUse(rawValue: "work")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "support@HL7.org") XCTAssertEqual(inst.copyright, "© HL7.org 2011+") XCTAssertEqual(inst.date?.description, "2016-09-26") @@ -752,7 +754,7 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.profile?[0].reference, "http://hl7.org/fhir/StructureDefinition/Patient") XCTAssertEqual(inst.publisher, "HL7") XCTAssertEqual(inst.purpose, "Patient Conditional Create (Update), Read and Delete Operations") - XCTAssertEqual(inst.setup?.action?[0].operation?.accept, "json") + XCTAssertEqual(inst.setup?.action?[0].operation?.accept, ContentType(rawValue: "json")!) XCTAssertEqual(inst.setup?.action?[0].operation?.description_fhir, "Execute a delete operation to insure the patient does not exist on the server.") XCTAssertEqual(inst.setup?.action?[0].operation?.label, "SetupDeletePatient") XCTAssertEqual(inst.setup?.action?[0].operation?.params, "/${createResourceId}") @@ -760,11 +762,11 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.setup?.action?[0].operation?.type?.code, "delete") XCTAssertEqual(inst.setup?.action?[0].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.setup?.action?[1].assert?.description_fhir, "Confirm that the returned HTTP status is 200(OK) or 204(No Content).") - XCTAssertEqual(inst.setup?.action?[1].assert?.direction, "response") - XCTAssertEqual(inst.setup?.action?[1].assert?.operator_fhir, "in") + XCTAssertEqual(inst.setup?.action?[1].assert?.direction, AssertionDirectionType(rawValue: "response")!) + XCTAssertEqual(inst.setup?.action?[1].assert?.operator_fhir, AssertionOperatorType(rawValue: "in")!) XCTAssertEqual(inst.setup?.action?[1].assert?.responseCode, "200,204") - XCTAssertEqual(inst.setup?.action?[2].operation?.accept, "json") - XCTAssertEqual(inst.setup?.action?[2].operation?.contentType, "json") + XCTAssertEqual(inst.setup?.action?[2].operation?.accept, ContentType(rawValue: "json")!) + XCTAssertEqual(inst.setup?.action?[2].operation?.contentType, ContentType(rawValue: "json")!) XCTAssertEqual(inst.setup?.action?[2].operation?.description_fhir, "Create patient resource on test server using the contents of fixture-patient-create") XCTAssertEqual(inst.setup?.action?[2].operation?.label, "SetupCreatePatient") XCTAssertEqual(inst.setup?.action?[2].operation?.params, "/${createResourceId}") @@ -773,9 +775,9 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.setup?.action?[2].operation?.type?.code, "update") XCTAssertEqual(inst.setup?.action?[2].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.setup?.action?[3].assert?.description_fhir, "Confirm that the returned HTTP status is 201(Created).") - XCTAssertEqual(inst.setup?.action?[3].assert?.direction, "response") + XCTAssertEqual(inst.setup?.action?[3].assert?.direction, AssertionDirectionType(rawValue: "response")!) XCTAssertEqual(inst.setup?.action?[3].assert?.responseCode, "201") - XCTAssertEqual(inst.status, "draft") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) XCTAssertEqual(inst.teardown?.action?[0].operation?.description_fhir, "Delete the patient resource on the test server using the id from fixture-patient-create.") XCTAssertEqual(inst.teardown?.action?[0].operation?.resource, "Patient") XCTAssertEqual(inst.teardown?.action?[0].operation?.targetId, "fixture-patient-create") @@ -789,31 +791,31 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.test?[0].action?[0].operation?.type?.code, "read") XCTAssertEqual(inst.test?[0].action?[0].operation?.type?.system?.absoluteString, "http://hl7.org/fhir/testscript-operation-codes") XCTAssertEqual(inst.test?[0].action?[1].assert?.description_fhir, "Confirm that the returned HTTP status is 200(OK).") - XCTAssertEqual(inst.test?[0].action?[1].assert?.direction, "response") + XCTAssertEqual(inst.test?[0].action?[1].assert?.direction, AssertionDirectionType(rawValue: "response")!) XCTAssertEqual(inst.test?[0].action?[1].assert?.label, "01-ReadPatientOK") - XCTAssertEqual(inst.test?[0].action?[1].assert?.response, "okay") + XCTAssertEqual(inst.test?[0].action?[1].assert?.response, AssertionResponseTypes(rawValue: "okay")!) XCTAssertEqual(inst.test?[0].action?[2].assert?.description_fhir, "Confirm that the returned HTTP Header Last-Modified is present. Warning only as the server may not support versioning.") - XCTAssertEqual(inst.test?[0].action?[2].assert?.direction, "response") + XCTAssertEqual(inst.test?[0].action?[2].assert?.direction, AssertionDirectionType(rawValue: "response")!) XCTAssertEqual(inst.test?[0].action?[2].assert?.headerField, "Last-Modified") - XCTAssertEqual(inst.test?[0].action?[2].assert?.operator_fhir, "notEmpty") + XCTAssertEqual(inst.test?[0].action?[2].assert?.operator_fhir, AssertionOperatorType(rawValue: "notEmpty")!) XCTAssertTrue(inst.test?[0].action?[2].assert?.warningOnly ?? false) XCTAssertEqual(inst.test?[0].action?[3].assert?.description_fhir, "Confirm that the returned resource type is Patient.") XCTAssertEqual(inst.test?[0].action?[3].assert?.resource, "Patient") XCTAssertEqual(inst.test?[0].action?[4].assert?.description_fhir, "Confirm that the returned Patient conforms to the base FHIR specification.") XCTAssertEqual(inst.test?[0].action?[4].assert?.validateProfileId, "patient-profile") XCTAssertEqual(inst.test?[0].action?[5].assert?.description_fhir, "Confirm that the returned Patient contains the expected family name 'Chalmers'. Uses explicit sourceId reference to read responseId fixture.") - XCTAssertEqual(inst.test?[0].action?[5].assert?.operator_fhir, "equals") + XCTAssertEqual(inst.test?[0].action?[5].assert?.operator_fhir, AssertionOperatorType(rawValue: "equals")!) XCTAssertEqual(inst.test?[0].action?[5].assert?.path, "fhir:Patient/fhir:name/fhir:family/@value") XCTAssertEqual(inst.test?[0].action?[5].assert?.sourceId, "fixture-patient-read") XCTAssertEqual(inst.test?[0].action?[5].assert?.value, "Chalmers") XCTAssertEqual(inst.test?[0].action?[6].assert?.description_fhir, "Confirm that the returned Patient contains the expected given name 'Peter'. Uses explicit sourceId reference to read responseId fixture.") - XCTAssertEqual(inst.test?[0].action?[6].assert?.operator_fhir, "equals") + XCTAssertEqual(inst.test?[0].action?[6].assert?.operator_fhir, AssertionOperatorType(rawValue: "equals")!) XCTAssertEqual(inst.test?[0].action?[6].assert?.path, "fhir:Patient/fhir:name/fhir:given/@value") XCTAssertEqual(inst.test?[0].action?[6].assert?.sourceId, "fixture-patient-read") XCTAssertEqual(inst.test?[0].action?[6].assert?.value, "Peter") XCTAssertEqual(inst.test?[0].action?[7].assert?.compareToSourceId, "fixture-patient-create") XCTAssertEqual(inst.test?[0].action?[7].assert?.compareToSourcePath, "fhir:Patient/fhir:name/fhir:family/@value") - XCTAssertEqual(inst.test?[0].action?[7].assert?.operator_fhir, "equals") + XCTAssertEqual(inst.test?[0].action?[7].assert?.operator_fhir, AssertionOperatorType(rawValue: "equals")!) XCTAssertEqual(inst.test?[0].action?[7].assert?.path, "fhir:Patient/fhir:name/fhir:family/@value") XCTAssertEqual(inst.test?[0].action?[8].assert?.compareToSourceId, "fixture-patient-create") XCTAssertEqual(inst.test?[0].action?[8].assert?.compareToSourcePath, "fhir:Patient/fhir:name/fhir:given/@value") @@ -825,7 +827,7 @@ class TestScriptTests: XCTestCase { XCTAssertEqual(inst.test?[0].description_fhir, "Read a Patient and validate response.") XCTAssertEqual(inst.test?[0].id, "01-ReadPatient") XCTAssertEqual(inst.test?[0].name, "Read Patient") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/TestScript/testscript-example") XCTAssertEqual(inst.variable?[0].name, "createResourceId") XCTAssertEqual(inst.variable?[0].path, "Patient/id") diff --git a/Tests/ModelTests/ValueSetTests.swift b/Tests/ModelTests/ValueSetTests.swift index 7d08c95e..3aab9a6c 100644 --- a/Tests/ModelTests/ValueSetTests.swift +++ b/Tests/ModelTests/ValueSetTests.swift @@ -2,7 +2,7 @@ // ValueSetTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -34,11 +34,11 @@ class ValueSetTests: XCTestCase { func runValueSet1(_ json: FHIRJSON? = nil) throws -> SwiftFHIR.ValueSet { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "valueset-example-expansion.json") - XCTAssertEqual(inst.compose?.include?[0].filter?[0].op, "=") + XCTAssertEqual(inst.compose?.include?[0].filter?[0].op, FilterOperator(rawValue: "=")!) XCTAssertEqual(inst.compose?.include?[0].filter?[0].property, "parent") XCTAssertEqual(inst.compose?.include?[0].filter?[0].value, "LP43571-6") XCTAssertEqual(inst.compose?.include?[0].system?.absoluteString, "http://loinc.org") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "http://hl7.org/fhir") XCTAssertEqual(inst.copyright, "This content from LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use.") XCTAssertEqual(inst.date?.description, "2015-06-22") @@ -92,8 +92,8 @@ class ValueSetTests: XCTestCase { XCTAssertEqual(inst.meta?.profile?[0].absoluteString, "http://hl7.org/fhir/StructureDefinition/valueset-shareable-definition") XCTAssertEqual(inst.name, "LOINC Codes for Cholesterol in Serum/Plasma") XCTAssertEqual(inst.publisher, "FHIR Project team") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/ValueSet/example-expansion") XCTAssertEqual(inst.version, "20150622") @@ -117,12 +117,12 @@ class ValueSetTests: XCTestCase { XCTAssertEqual(inst.compose?.exclude?[0].concept?[0].code, "5932-9") XCTAssertEqual(inst.compose?.exclude?[0].concept?[0].display, "Cholesterol [Presence] in Blood by Test strip") XCTAssertEqual(inst.compose?.exclude?[0].system?.absoluteString, "http://loinc.org") - XCTAssertEqual(inst.compose?.include?[0].filter?[0].op, "=") + XCTAssertEqual(inst.compose?.include?[0].filter?[0].op, FilterOperator(rawValue: "=")!) XCTAssertEqual(inst.compose?.include?[0].filter?[0].property, "parent") XCTAssertEqual(inst.compose?.include?[0].filter?[0].value, "LP43571-6") XCTAssertEqual(inst.compose?.include?[0].system?.absoluteString, "http://loinc.org") XCTAssertEqual(inst.contact?[0].name, "FHIR project team") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "http://hl7.org/fhir") XCTAssertEqual(inst.copyright, "This content from LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use") XCTAssertEqual(inst.date?.description, "2015-06-22") @@ -134,8 +134,8 @@ class ValueSetTests: XCTestCase { XCTAssertEqual(inst.meta?.profile?[0].absoluteString, "http://hl7.org/fhir/StructureDefinition/valueset-shareable-definition") XCTAssertEqual(inst.name, "LOINC Codes for Cholesterol in Serum/Plasma") XCTAssertEqual(inst.publisher, "HL7 International") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/ValueSet/example-intensional") XCTAssertEqual(inst.version, "20150622") @@ -174,8 +174,8 @@ class ValueSetTests: XCTestCase { XCTAssertEqual(inst.expansion?.timestamp?.description, "2015-07-14T10:00:00Z") XCTAssertEqual(inst.id, "yesnodontknow") XCTAssertEqual(inst.name, "Yes/No/Don't Know") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/ValueSet/yesnodontknow") return inst @@ -207,7 +207,7 @@ class ValueSetTests: XCTestCase { XCTAssertEqual(inst.compose?.include?[0].version, "2.36") XCTAssertEqual(inst.compose?.lockedDate?.description, "2012-06-13") XCTAssertEqual(inst.contact?[0].name, "FHIR project team") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "http://hl7.org/fhir") XCTAssertEqual(inst.copyright, "This content from LOINC® is copyright © 1995 Regenstrief Institute, Inc. and the LOINC Committee, and available at no cost under the license at http://loinc.org/terms-of-use.") XCTAssertEqual(inst.date?.description, "2015-06-22") @@ -219,8 +219,8 @@ class ValueSetTests: XCTestCase { XCTAssertEqual(inst.meta?.profile?[0].absoluteString, "http://hl7.org/fhir/StructureDefinition/valueset-shareable-definition") XCTAssertEqual(inst.name, "LOINC Codes for Cholesterol in Serum/Plasma") XCTAssertEqual(inst.publisher, "HL7 International") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/ValueSet/example-extensional") XCTAssertEqual(inst.version, "20150622") @@ -242,20 +242,20 @@ class ValueSetTests: XCTestCase { let inst = (nil != json) ? try instantiateFrom(json: json!) : try instantiateFrom(filename: "valueset-list-example-codes.json") XCTAssertEqual(inst.compose?.include?[0].system?.absoluteString, "http://hl7.org/fhir/list-example-use-codes") - XCTAssertEqual(inst.contact?[0].telecom?[0].system, "other") + XCTAssertEqual(inst.contact?[0].telecom?[0].system, ContactPointSystem(rawValue: "other")!) XCTAssertEqual(inst.contact?[0].telecom?[0].value, "http://hl7.org/fhir") - XCTAssertEqual(inst.date?.description, "2016-11-01T13:32:59+00:00") + XCTAssertEqual(inst.date?.description, "2016-11-04T22:07:34+00:00") XCTAssertEqual(inst.description_fhir, "Example use codes for the List resource - typical kinds of use.") XCTAssertTrue(inst.experimental ?? false) XCTAssertEqual(inst.id, "list-example-codes") XCTAssertEqual(inst.identifier?[0].system?.absoluteString, "urn:ietf:rfc:3986") XCTAssertEqual(inst.identifier?[0].value, "urn:oid:2.16.840.1.113883.4.642.2.173") - XCTAssertEqual(inst.meta?.lastUpdated?.description, "2016-11-01T13:32:59.924+00:00") + XCTAssertEqual(inst.meta?.lastUpdated?.description, "2016-11-04T22:07:34.007+00:00") XCTAssertEqual(inst.meta?.profile?[0].absoluteString, "http://hl7.org/fhir/StructureDefinition/valueset-shareable-definition") XCTAssertEqual(inst.name, "Example Use Codes for List") XCTAssertEqual(inst.publisher, "FHIR Project") - XCTAssertEqual(inst.status, "draft") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, PublicationStatus(rawValue: "draft")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) XCTAssertEqual(inst.url?.absoluteString, "http://hl7.org/fhir/ValueSet/list-example-codes") XCTAssertEqual(inst.version, "1.7.0") diff --git a/Tests/ModelTests/VisionPrescriptionTests.swift b/Tests/ModelTests/VisionPrescriptionTests.swift index 3df3b084..07342e0e 100644 --- a/Tests/ModelTests/VisionPrescriptionTests.swift +++ b/Tests/ModelTests/VisionPrescriptionTests.swift @@ -2,7 +2,7 @@ // VisionPrescriptionTests.swift // SwiftFHIR // -// Generated from FHIR 1.7.0.10104 on 2016-11-03. +// Generated from FHIR 1.7.0.10127 on 2016-11-04. // 2016, SMART Health IT. // @@ -46,7 +46,7 @@ class VisionPrescriptionTests: XCTestCase { XCTAssertEqual(inst.dispense?[0].duration?.system?.absoluteString, "http://unitsofmeasure.org") XCTAssertEqual(inst.dispense?[0].duration?.unit, "month") XCTAssertEqual(inst.dispense?[0].duration?.value, NSDecimalNumber(string: "1")) - XCTAssertEqual(inst.dispense?[0].eye, "right") + XCTAssertEqual(inst.dispense?[0].eye, VisionEyes(rawValue: "right")!) XCTAssertEqual(inst.dispense?[0].power, NSDecimalNumber(string: "-2.75")) XCTAssertEqual(inst.dispense?[0].product?.code, "contact") XCTAssertEqual(inst.dispense?[0].product?.system?.absoluteString, "http://hl7.org/fhir/ex-visionprescriptionproduct") @@ -61,7 +61,7 @@ class VisionPrescriptionTests: XCTestCase { XCTAssertEqual(inst.dispense?[1].duration?.system?.absoluteString, "http://unitsofmeasure.org") XCTAssertEqual(inst.dispense?[1].duration?.unit, "month") XCTAssertEqual(inst.dispense?[1].duration?.value, NSDecimalNumber(string: "1")) - XCTAssertEqual(inst.dispense?[1].eye, "left") + XCTAssertEqual(inst.dispense?[1].eye, VisionEyes(rawValue: "left")!) XCTAssertEqual(inst.dispense?[1].power, NSDecimalNumber(string: "-2.75")) XCTAssertEqual(inst.dispense?[1].product?.code, "contact") XCTAssertEqual(inst.dispense?[1].product?.system?.absoluteString, "http://hl7.org/fhir/ex-visionprescriptionproduct") @@ -70,9 +70,9 @@ class VisionPrescriptionTests: XCTestCase { XCTAssertEqual(inst.identifier?[0].value, "15014") XCTAssertEqual(inst.patient?.reference, "Patient/example") XCTAssertEqual(inst.prescriber?.reference, "Practitioner/example") - XCTAssertEqual(inst.status, "active") + XCTAssertEqual(inst.status, VisionStatus(rawValue: "active")!) XCTAssertEqual(inst.text?.div, "
Sample Contract Lens prescription
") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } @@ -93,17 +93,17 @@ class VisionPrescriptionTests: XCTestCase { XCTAssertEqual(inst.dateWritten?.description, "2014-06-15") XCTAssertEqual(inst.dispense?[0].add, NSDecimalNumber(string: "2.0")) - XCTAssertEqual(inst.dispense?[0].base, "down") - XCTAssertEqual(inst.dispense?[0].eye, "right") + XCTAssertEqual(inst.dispense?[0].base, VisionBase(rawValue: "down")!) + XCTAssertEqual(inst.dispense?[0].eye, VisionEyes(rawValue: "right")!) XCTAssertEqual(inst.dispense?[0].prism, NSDecimalNumber(string: "0.5")) XCTAssertEqual(inst.dispense?[0].product?.code, "lens") XCTAssertEqual(inst.dispense?[0].product?.system?.absoluteString, "http://hl7.org/fhir/ex-visionprescriptionproduct") XCTAssertEqual(inst.dispense?[0].sphere, NSDecimalNumber(string: "-2.0")) XCTAssertEqual(inst.dispense?[1].add, NSDecimalNumber(string: "2.0")) XCTAssertEqual(inst.dispense?[1].axis, 180) - XCTAssertEqual(inst.dispense?[1].base, "up") + XCTAssertEqual(inst.dispense?[1].base, VisionBase(rawValue: "up")!) XCTAssertEqual(inst.dispense?[1].cylinder, NSDecimalNumber(string: "-0.5")) - XCTAssertEqual(inst.dispense?[1].eye, "left") + XCTAssertEqual(inst.dispense?[1].eye, VisionEyes(rawValue: "left")!) XCTAssertEqual(inst.dispense?[1].prism, NSDecimalNumber(string: "0.5")) XCTAssertEqual(inst.dispense?[1].product?.code, "lens") XCTAssertEqual(inst.dispense?[1].product?.system?.absoluteString, "http://hl7.org/fhir/ex-visionprescriptionproduct") @@ -113,8 +113,8 @@ class VisionPrescriptionTests: XCTestCase { XCTAssertEqual(inst.identifier?[0].value, "15013") XCTAssertEqual(inst.patient?.reference, "Patient/example") XCTAssertEqual(inst.prescriber?.reference, "Practitioner/example") - XCTAssertEqual(inst.status, "active") - XCTAssertEqual(inst.text?.status, "generated") + XCTAssertEqual(inst.status, VisionStatus(rawValue: "active")!) + XCTAssertEqual(inst.text?.status, NarrativeStatus(rawValue: "generated")!) return inst } diff --git a/Tests/ResourceTests.swift b/Tests/ResourceTests.swift index a683b24e..975e9ccf 100644 --- a/Tests/ResourceTests.swift +++ b/Tests/ResourceTests.swift @@ -62,7 +62,7 @@ class ResourceTests: XCTestCase { // normal `create` let patient = Patient() - patient.gender = "female" + patient.gender = .female patient.create(server) { error in XCTAssertNil(error) XCTAssertNotNil(patient.id) @@ -117,7 +117,7 @@ class ResourceTests: XCTestCase { // normal `createAndReturn` let patient = Patient() - patient.gender = "female" + patient.gender = .female patient.createAndReturn(server) { error in XCTAssertNil(error) XCTAssertNotNil(patient.id) diff --git a/Tests/ValidationTests.swift b/Tests/ValidationTests.swift index a6d5cb73..c2574cb4 100644 --- a/Tests/ValidationTests.swift +++ b/Tests/ValidationTests.swift @@ -46,12 +46,14 @@ class ValidationTests: XCTestCase { } catch let error as FHIRValidationError { let lines = error.description.components(separatedBy: CharacterSet.newlines) - XCTAssertEqual(5, lines.count) + XCTAssertEqual(7, lines.count) XCTAssertTrue(lines[0].hasPrefix("Questionnaire.item.1.item.0.type: "), lines[0]) - XCTAssertTrue(lines[1].hasPrefix("Questionnaire.item.2.option.0.value[x]: "), lines[1]) - XCTAssertTrue(lines[2].hasPrefix("Questionnaire.item.2.option.0.valueNumber: "), lines[2]) - XCTAssertTrue(lines[3].hasPrefix("Questionnaire.item.2.option.1.valueCoding.code: "), lines[3]) - XCTAssertTrue(lines[4].hasPrefix("Questionnaire.versino: "), lines[4]) + XCTAssertTrue(lines[1].hasPrefix("Questionnaire.item.1.item.1.type: "), lines[1]) + XCTAssertTrue(lines[2].hasPrefix("Questionnaire.item.2.option.0.value[x]: "), lines[2]) + XCTAssertTrue(lines[3].hasPrefix("Questionnaire.item.2.option.0.valueNumber: "), lines[3]) + XCTAssertTrue(lines[4].hasPrefix("Questionnaire.item.2.option.1.valueCoding.code: "), lines[4]) + XCTAssertTrue(lines[5].hasPrefix("Questionnaire.status: "), lines[5]) + XCTAssertTrue(lines[6].hasPrefix("Questionnaire.versino: "), lines[6]) } catch let error { XCTAssertNil(error, "Should not have gotten this error") @@ -59,9 +61,9 @@ class ValidationTests: XCTestCase { } func testSerializationResource() { - let questionnaire1 = Questionnaire(status: "draft") - XCTAssertEqual("draft", questionnaire1.status) - let item = QuestionnaireItem(type: "display") + let questionnaire1 = Questionnaire(status: .draft) + XCTAssertEqual("draft", questionnaire1.status?.rawValue) + let item = QuestionnaireItem(type: .display) item.text = "This is an empty questionnaire" questionnaire1.item = [item] do { diff --git a/fhir-parser b/fhir-parser index 4d7fde59..9bba8156 160000 --- a/fhir-parser +++ b/fhir-parser @@ -1 +1 @@ -Subproject commit 4d7fde596b38e31e862d8b7fd81a726b3680bf2f +Subproject commit 9bba81564d57d473b3da77b85c4c7508ec3ee83f diff --git a/generate.sh b/generate.sh index b9e30b99..d64111d6 100755 --- a/generate.sh +++ b/generate.sh @@ -9,5 +9,5 @@ fi # always copy our settings, then run the generator cd fhir-parser cp ../generator-settings.py ./settings.py -./generate.py $1 +./generate.py $1 $2 cd ..