SMART on FHIR Python Client 4.2.0
 
Loading...
Searching...
No Matches
fhirclient.models.fhirtime.FHIRTime Class Reference

A convenience class for working with FHIR times in Python. More...

Inheritance diagram for fhirclient.models.fhirtime.FHIRTime:
fhirclient.models.fhirdate.FHIRDate

Public Member Functions

 __init__ (self, Union[str, None] jsonval=None)
 
- Public Member Functions inherited from fhirclient.models.fhirdate.FHIRDate
 __setattr__ (self, prop, value)
 
 with_json (cls, Union[str, list] jsonobj)
 Initialize a date from an ISO date string.
 
 with_json_and_owner (cls, Union[str, list] jsonobj, owner)
 Added for compatibility reasons to FHIRElement; "owner" is discarded.
 
Union[str, None] as_json (self)
 Returns the original JSON string used to create this instance.
 

Static Protected Member Functions

Any _from_string (str value)
 
- Static Protected Member Functions inherited from fhirclient.models.fhirdate.FHIRDate
 _parse_partial (str value, cls)
 Handle partial dates like 1970 or 1980-12.
 
datetime.date _parse_date (str value)
 
datetime.datetime _parse_datetime (str value)
 
datetime.time _parse_time (str value)
 
str _strip_leap_seconds (str value)
 Manually ignore leap seconds by clamping the seconds value to 59.
 

Static Protected Attributes

 _REGEX
 Private properties and methods #.
 
str _FIELD
 
- Static Protected Attributes inherited from fhirclient.models.fhirdate.FHIRDate
 _REGEX
 Private properties and methods #.
 
str _FIELD
 

Additional Inherited Members

- Public Attributes inherited from fhirclient.models.fhirdate.FHIRDate
 date
 
 origval
 
- Protected Attributes inherited from fhirclient.models.fhirdate.FHIRDate
 _FIELD
 
- Properties inherited from fhirclient.models.fhirdate.FHIRDate
 isostring = property
 Returns a standardized ISO 8601 version of the Python representation of the FHIR JSON.
 

Detailed Description

A convenience class for working with FHIR times in Python.

http://hl7.org/fhir/R4/datatypes.html#time

Converting to a Python representation does require some compromises:

  • FHIR allows arbitrary sub-second precision, but Python only holds microseconds.
  • Leap seconds (:60) will be changed to the 59th second (:59) because Python's time classes do not support leap seconds.

If such compromise is not useful for you, avoid using the date, time, or isostring properties and just use the as_json() method in order to work with the original, exact string.

Public properties:

  • time: datetime.time representing the JSON value
  • date: backwards-compatibility alias for time
  • isostring: an ISO 8601 string version of the above Python object

Public methods:

  • as_json: returns the original JSON used to construct the instance

Constructor & Destructor Documentation

◆ __init__()

fhirclient.models.fhirtime.FHIRTime.__init__ (   self,
Union[str, None]   jsonval = None 
)

Member Function Documentation

◆ _from_string()

Any fhirclient.models.fhirtime.FHIRTime._from_string ( str  value)
staticprotected

Member Data Documentation

◆ _FIELD

fhirclient.models.fhirtime.FHIRTime._FIELD
staticprotected

◆ _REGEX

fhirclient.models.fhirtime.FHIRTime._REGEX
staticprotected

Private properties and methods #.


The documentation for this class was generated from the following file: