def __set_gnu_when_given(self):
     """Set datetime when given"""
     # TODO Maybe add hours, minutes, etc.
     if self.medication_statement:
         start = safe_attrgetter(self.medication_statement,
                                 self.map['when-given']['start'])
         end = safe_attrgetter(self.medication_statement,
                               self.map['when-given']['end'])
         if start:
             p = supermod.Period()
             p.start = supermod.dateTime(value=start.strftime('%Y/%m/%d'))
             if end:
                 p.end = supermod.dateTime(value=end.strftime('%Y/%m/%d'))
             self.set_whenGiven(p)
Exemplo n.º 2
0
    def set_date(self, start, end):
        """Extends superclass for convenience

        Keyword arguments:
        start -- the start date (datetime object)
        end -- the end date (datetime object)
        """
        #TODO Better specifics

        if start is not None:
            p = supermod.Period()
            p.start = supermod.dateTime(value=start.strftime("%Y/%m/%d"))
            if end is not None:
                p.end = supermod.dateTime(value=end.strftime("%Y/%m/%d"))
            super(health_Procedure, self).set_date(p)
    def set_date(self, date):
        """Extends superclass for convenience

        Keyword arguments:
        date -- date (datetime object)
        """

        if date is not None:
            d = supermod.dateTime(value=date.strftime("%Y/%m/%d"))
            super(health_Immunization, self).set_date(d)
    def set_deceasedDatetime(self, dod):
        """Extends superclass for convenience

        Set the deceased date and time

        Keyword arguments:
        dod -- deceased datetime object
        """

        if dod is not None:
            super(health_Patient, self).set_deceasedDateTime(
                supermod.dateTime(value=dod.strftime("%Y/%m/%d")))
    def set_birthDate(self, birthdate):
        """Extends superclass for convenience

        Set patient's birthdate

        Keyword arguments:
        birthdate -- birthdate datetime object
        """

        if birthdate is not None:
            dob = supermod.dateTime(value=birthdate.strftime("%Y/%m/%d"))
            super(health_Patient, self).set_birthDate(dob)