def set_active(self, active=True): """Extend superclass Set the active status Keyword arguments: active - active status (boolean) """ if active in [True, 'true']: d = supermod.boolean(value='true') else: d = supermod.boolean(value='false') super(health_Organization, self).set_active(d)
def set_reported(self, reported=False): """Extends superclass for convenience Keyword argument: reported -- self reported? True/False (default: False) """ b = 'false' if reported: b = 'true' r = supermod.boolean(value=b) super(health_Immunization, self).set_reported(r)
def set_refusedIndicator(self, refusedIndicator=False): """Extends superclass for convenience Keyword argument: refusedIndicator -- refused? True/False (default: False) """ b = 'false' if refusedIndicator: b = 'true' ri = supermod.boolean(value=b) super(health_Immunization, self).set_refusedIndicator(ri)
def set_active(self, active=True): """Extends superclass for convenience Set active status Keyword arguments: active -- status ('true' or 'false') """ if active: active = 'true' else: active = 'false' super(health_Patient, self).set_active(supermod.boolean(value=active))
def set_deceasedBoolean(self, status=False): """Extends superclass for convenience Set whether patient is deceased or not Keyword arguments: status -- deceased status (True or False) """ if status: status = 'true' else: status = 'false' b = supermod.boolean(value=status) super(health_Patient, self).set_deceasedBoolean(b)
def __set_gnu_dosage(self): """Set dosage""" # TODO Add better dosage info # FIX On hold since many changes upcoming to the dosage if self.medication_statement: d = supermod.MedicationStatement_Dosage() d.quantity = supermod.Quantity() f = safe_attrgetter(self.medication_statement, self.map['dose']['quantity']) if f: d.quantity.value = supermod.decimal(value=f) u = safe_attrgetter(self.medication_statement, self.map['dose']['units']) if u: d.quantity.units = supermod.string(value=u) d.route = supermod.CodeableConcept() r = safe_attrgetter(self.medication_statement, self.map['dose']['route']) if r: d.route.coding = [supermod.Coding()] d.route.coding[0].code = supermod.code(value=r.code) d.route.coding[0].display = supermod.string(value=r.name) d.route.text = supermod.string(r.name) # PRN? an = safe_attrgetter(self.medication_statement, self.map['dose']['asNeededBoolean']) if an: self.set_asNeededBoolean(supermod.boolean(value=True)) d.timing = supermod.Schedule() if self.medication_statement.infusion: d.rate