Semantics in FRED spec

Hello,

I was just reading the schemas posted on the github and had a question about semantics of data in some of the fields. I assume that some fields such as “status” will have their value drawn from a codified list of mnemonics (categoryCode would be another). Is this a correct assumption?

If so, I had a few thoughts based on my experiences with HL7 and IHE that might help make the semantics more obvious to future integrators.

One suggestion would be restricting the allowed values for particular fields to a set of semantic values (this is quite restrictive and may reduce the “permissiveness” of the schema):

<xs:element name=“status”>
<xs:simpleType >
<xs:restriction base=“xs:NCName”>
<xs:enumeration value=“open”>

xs:annotation

xs:documentationThe facility is in the OPEN state which means … </xs:documentation>

</xs:annotation>

</xs:enumeration>
<xs:enumeration value=“closed”/>
</xs:restriction>
</xs:simpleType>
</xs:element>

Another option/suggestion would be using a type akin to HL7’s CX datatype (example: 1234-5^^^LN which says code 1234-5 from LOINC) where a code and coding scheme could be selected :

<xs:element name=“status” type=“fac:codeValue”/>
<xs:complexType name=“codeValue”>
<xs:attribute name=“value” type=“xs:NCName”>

xs:annotation

xs:documentationThe value of the codified data</xs:documentation>

</xs:annotation>

</xs:attribute>
<xs:attribute name=“scheme” type=“xs:anyURI”>
xs:annotation
xs:documentationThe codification scheme from which the value was selected</xs:documentation>

</xs:annotation>

</xs:attribute>
</xs:complexType>

This is more permissive, closely aligned with HL7 and would allow instances to (in the future) translate codes that are not understood locally.

Is this something that is planned to be specified at a data contract level (XSD)? Or will it be put in the spec document? Or will it be left for implementers to define?

IMO we should be very clear about the semantic meaning of each data element, being permissive is great for adoption however it makes interoperability more difficult in the long run as the specification evolves.

Thanks

-Justin

Hi Justin

Thanks for this important observation. As you have noticed, we have
kind of skirted (ignored) the issue of controlled vocabularies but I
do agree we need to address this.

The original schema that was being used in Rwanda does as you
illustrate in the first example - ie. uses a restriction in the
schema. I do agree that this "hard-coding" is not ideal and I raised
the same point in my early comments on what was being proposed there.

I would be much more in favour of something closer to your second
example. There still remains the problem of dereferencing the scheme
url to an actual codelist in a reasonably predictable way but I think
we should think about the best way to do that.

Having said all that, the samples you have looked at are not
necessarily the best illustration of this problem. In DHIS for
example we have 'status' as a binary field (true or false). The most
important purpose of this field being to easily determine whether data
coming in for a particular facility should be accepted or not. In
Rwanda they made it ternary to accomodate open, closed or planned
(hence necessitating a code list). Personally I would rather keep
this particular field binary. But that doesn't detract from your
general point.

Also categoryCode in the sample is currently in the "extended" rm
namespace so the same semantics don't necessarily need to apply, but
it is also a good candidate for what could be in the more prescriptive
facility namespace. Facility category is something we say just about
everywhere.

I do agree about the importance of absolute clarity of the semantics
of the dataelements. It certainly wasn't my intention to advocate
permissiveness here .. just that you spotted an over sight on my
behalf. I am sure there are more :slight_smile:

So lets give some thought to a way of implementing your second
suggestion which is on the one hand sufficiently flexible, and on the
other not over-burdensome on implementers.

On a more general point about specifying precise sematics of elements
and attributes, that is the purpose of the empty space currently in
the specification document. It would be a god idea to annotate the
schema properly with xs:documentation rather than my ad-hoc xml
comments so that much of this could be derived from the schema
document itself.

Regards
Bob

···

On 4 October 2012 17:25, Justin (Mohawk College) <justin.fyfe1@mohawkcollege.ca> wrote:

Hello,

I was just reading the schemas posted on the github and had a question about
semantics of data in some of the fields. I assume that some fields such as
"status" will have their value drawn from a codified list of mnemonics
(categoryCode would be another). Is this a correct assumption?

If so, I had a few thoughts based on my experiences with HL7 and IHE that
might help make the semantics more obvious to future integrators.

One suggestion would be restricting the allowed values for particular fields
to a set of semantic values (this is quite restrictive and may reduce the
"permissiveness" of the schema):

  <xs:element name="status">
    <xs:simpleType >
      <xs:restriction base="xs:NCName">
        <xs:enumeration value="open">
             <xs:annotation>
                 <xs:documentation>The facility is in the OPEN state which
means ... </xs:documentation>
             </xs:annotation>
        </xs:enumeration>
        <xs:enumeration value="closed"/>
      </xs:restriction>
    </xs:simpleType>
  </xs:element>
Another option/suggestion would be using a type akin to HL7's CX datatype
(example: 1234-5^^^LN which says code 1234-5 from LOINC) where a code and
coding scheme could be selected :

  <xs:element name="status" type="fac:codeValue"/>
  <xs:complexType name="codeValue">
    <xs:attribute name="value" type="xs:NCName">
        <xs:annotation>
            <xs:documentation>The value of the codified
data</xs:documentation>
         </xs:annotation>
    </xs:attribute>
    <xs:attribute name="scheme" type="xs:anyURI">
        <xs:annotation>
            <xs:documentation>The codification scheme from which the value
was selected</xs:documentation>
         </xs:annotation>
      </xs:attribute>
  </xs:complexType>

This is more permissive, closely aligned with HL7 and would allow instances
to (in the future) translate codes that are not understood locally.

Is this something that is planned to be specified at a data contract level
(XSD)? Or will it be put in the spec document? Or will it be left for
implementers to define?

IMO we should be very clear about the semantic meaning of each data element,
being permissive is great for adoption however it makes interoperability
more difficult in the long run as the specification evolves.

Thanks
-Justin

--

Hey Everyone,

First off, big kudos to Bob for digging right in and producing an XML spec. It’s a great start, and also great to have something tangible to sink our teeth into.

A few very small comments:

  • I’m a little antsy of including something as generic as ‘status’ in the facility specification document, as it begs to be misunderstood/misused. Perhaps, in addition to linking it to a coding scheme, we could relegate that metadata to another namespace for now (e.g. the ‘extended’ namespace). Or at minimum change it to something more precise, like ‘active’.
  • We could change the reference to 'url’s to be 'uri’s, since much of the time, particularly for internal references, these may not map to web resources.
  • I like Bob’s suggestion in the Registry API Doc of including not just the approval date but also the approval authority, since even with a single government there may be many different legitimate authorities. Let’s also make that a DateTime.

Please keep me posted on further discussions.

Cheers,

Rowena

···

On Thu, Oct 4, 2012 at 1:41 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Hi Justin

Thanks for this important observation. As you have noticed, we have

kind of skirted (ignored) the issue of controlled vocabularies but I

do agree we need to address this.

The original schema that was being used in Rwanda does as you

illustrate in the first example - ie. uses a restriction in the

schema. I do agree that this “hard-coding” is not ideal and I raised

the same point in my early comments on what was being proposed there.

I would be much more in favour of something closer to your second

example. There still remains the problem of dereferencing the scheme

url to an actual codelist in a reasonably predictable way but I think

we should think about the best way to do that.

Having said all that, the samples you have looked at are not

necessarily the best illustration of this problem. In DHIS for

example we have ‘status’ as a binary field (true or false). The most

important purpose of this field being to easily determine whether data

coming in for a particular facility should be accepted or not. In

Rwanda they made it ternary to accomodate open, closed or planned

(hence necessitating a code list). Personally I would rather keep

this particular field binary. But that doesn’t detract from your

general point.

Also categoryCode in the sample is currently in the “extended” rm

namespace so the same semantics don’t necessarily need to apply, but

it is also a good candidate for what could be in the more prescriptive

facility namespace. Facility category is something we say just about

everywhere.

I do agree about the importance of absolute clarity of the semantics

of the dataelements. It certainly wasn’t my intention to advocate

permissiveness here … just that you spotted an over sight on my

behalf. I am sure there are more :slight_smile:

So lets give some thought to a way of implementing your second

suggestion which is on the one hand sufficiently flexible, and on the

other not over-burdensome on implementers.

On a more general point about specifying precise sematics of elements

and attributes, that is the purpose of the empty space currently in

the specification document. It would be a god idea to annotate the

schema properly with xs:documentation rather than my ad-hoc xml

comments so that much of this could be derived from the schema

document itself.

Regards

Bob

On 4 October 2012 17:25, Justin (Mohawk College) > justin.fyfe1@mohawkcollege.ca wrote:

Hello,

I was just reading the schemas posted on the github and had a question about

semantics of data in some of the fields. I assume that some fields such as

“status” will have their value drawn from a codified list of mnemonics

(categoryCode would be another). Is this a correct assumption?

If so, I had a few thoughts based on my experiences with HL7 and IHE that

might help make the semantics more obvious to future integrators.

One suggestion would be restricting the allowed values for particular fields

to a set of semantic values (this is quite restrictive and may reduce the

“permissiveness” of the schema):

<xs:element name=“status”>

<xs:simpleType >
  <xs:restriction base="xs:NCName">
    <xs:enumeration value="open">
         <xs:annotation>
             <xs:documentation>The facility is in the OPEN state which

means … </xs:documentation>

         </xs:annotation>
    </xs:enumeration>
    <xs:enumeration value="closed"/>
  </xs:restriction>
</xs:simpleType>

</xs:element>

Another option/suggestion would be using a type akin to HL7’s CX datatype

(example: 1234-5^^^LN which says code 1234-5 from LOINC) where a code and

coding scheme could be selected :

<xs:element name=“status” type=“fac:codeValue”/>

<xs:complexType name=“codeValue”>

<xs:attribute name="value" type="xs:NCName">
    <xs:annotation>
        <xs:documentation>The value of the codified

data</xs:documentation>

     </xs:annotation>
</xs:attribute>
<xs:attribute name="scheme" type="xs:anyURI">
    <xs:annotation>
        <xs:documentation>The codification scheme from which the value

was selected</xs:documentation>

     </xs:annotation>
  </xs:attribute>

</xs:complexType>

This is more permissive, closely aligned with HL7 and would allow instances

to (in the future) translate codes that are not understood locally.

Is this something that is planned to be specified at a data contract level

(XSD)? Or will it be put in the spec document? Or will it be left for

implementers to define?

IMO we should be very clear about the semantic meaning of each data element,

being permissive is great for adoption however it makes interoperability

more difficult in the long run as the specification evolves.

Thanks

-Justin

Hi all,

Thanks much to Bob for the specs discussion today and the follow up comments from FRED teammates.
To add to the conversation, I am forwarding the relevant comments from Bob and Carl below. The google doc also remains available for capturing comments at https://docs.google.com/document/d/1Xkr5vioqjzyHrgpmKKhWzs8vx1dI9uaQR0ckLFrKI3Y/edit.

There will be further discussion on project management approaches to track these conversations and artifacts,
but the google doc and email chain can convey and capture the immediate follow up on the great start from Bob and others.

More information will be provided on the FRED
wiki structure in the Oct. 10 project management call or the Oct. 18 technical call. We also expect the next technical call to address use cases for FRED.

Today’s call recording is available at https://confluence.dimagi.com/display/facilityregistry/Conference+Call+Minutes+2012-10-04 .
I will post the meeting minutes there and disseminate when ready.

Keep up the collaborative conversation!

Best,
Kelly

···

From: Bob Jolliffe [bobjolliffe@gmail.com]

Sent: Thursday, October 04, 2012 12:32 PM

To: Carl Leitner

Cc: Kelly Keisling (NH); Fredrik Winsnes (NH); Dykki Settle; Luke Duncan

Subject: Re: (RSVP for) Continued FRED conversation in Rwanda

Hi Carl

On 4 October 2012 17:18, Carl Leitner cleitner@capacityplus.org wrote:

Hi Bob,

Thanks for getting us connected with this call.

I took a look at the github site. One thing I noticed here:

https://github.com/bobjolliffe/facility_reference/blob/master/rm.xsd
https://github.com/bobjolliffe/facility_reference/blob/master/rm.xml

is that there is a resource defined for the admin unit.

Has there been any consideration to adding a “health district”? We have repeatedly seen the need to track both the facility’s admin unit and health district.

We have talked a bit about this, hierarchies etc. Its a difficult

one. On the one hand keeping scope for a facility registry to manage

simply the list of facilities is easiest and cleanest.

We (DHIS) have found that, given how critical the hierarchy is to DHIS

functionality, it is actually quite risky having this managed by an

external service to whom it is not as semantically important.

So at the moment we are stumbling forward a bit on this. But Resource

Mapper, for example, does contain information on health district as

well as admin unit.

If iHRIS for example contains this as well it could expose it as an

iHRIS specific attribute (as RM does).

Or it could be you are suggesting - and this might make sense - that

health district (name and code) should be a candidate for

consideration within the standard facility reg namespace. If so, then

I agree.

Bob

Cheers,

-carl


From: facility-registry@googlegroups.com [facility-registry@googlegroups.com] on behalf of Rowena Luk [rluk@dimagi.com]
Sent: Thursday, October 04, 2012 2:35 PM
To: facility-registry@googlegroups.com
Subject: Re: Semantics in FRED spec

Hey Everyone,

First off, big kudos to Bob for digging right in and producing an XML spec. It’s a great start, and also great to have something tangible to sink our teeth into.

A few very small comments:

  • I’m a little antsy of including something as generic as ‘status’ in the facility specification document, as it begs to be misunderstood/misused. Perhaps, in addition to linking it to a coding scheme, we could relegate that metadata to another namespace
    for now (e.g. the ‘extended’ namespace). Or at minimum change it to something more precise, like ‘active’.
  • We could change the reference to 'url’s to be 'uri’s, since much of the time, particularly for internal references, these may not map to web resources.
  • I like Bob’s suggestion in the
    Registry API Doc
    of including not just the approval date but also the approval authority, since even with a single government there may be many different legitimate authorities. Let’s also make that a DateTime.

Please keep me posted on further discussions.

Cheers,

Rowena

On Thu, Oct 4, 2012 at 1:41 PM, Bob Jolliffe bobjolliffe@gmail.com wrote:

Hi Justin

Thanks for this important observation. As you have noticed, we have

kind of skirted (ignored) the issue of controlled vocabularies but I

do agree we need to address this.

The original schema that was being used in Rwanda does as you

illustrate in the first example - ie. uses a restriction in the

schema. I do agree that this “hard-coding” is not ideal and I raised

the same point in my early comments on what was being proposed there.

I would be much more in favour of something closer to your second

example. There still remains the problem of dereferencing the scheme

url to an actual codelist in a reasonably predictable way but I think

we should think about the best way to do that.

Having said all that, the samples you have looked at are not

necessarily the best illustration of this problem. In DHIS for

example we have ‘status’ as a binary field (true or false). The most

important purpose of this field being to easily determine whether data

coming in for a particular facility should be accepted or not. In

Rwanda they made it ternary to accomodate open, closed or planned

(hence necessitating a code list). Personally I would rather keep

this particular field binary. But that doesn’t detract from your

general point.

Also categoryCode in the sample is currently in the “extended” rm

namespace so the same semantics don’t necessarily need to apply, but

it is also a good candidate for what could be in the more prescriptive

facility namespace. Facility category is something we say just about

everywhere.

I do agree about the importance of absolute clarity of the semantics

of the dataelements. It certainly wasn’t my intention to advocate

permissiveness here … just that you spotted an over sight on my

behalf. I am sure there are more :slight_smile:

So lets give some thought to a way of implementing your second

suggestion which is on the one hand sufficiently flexible, and on the

other not over-burdensome on implementers.

On a more general point about specifying precise sematics of elements

and attributes, that is the purpose of the empty space currently in

the specification document. It would be a god idea to annotate the

schema properly with xs:documentation rather than my ad-hoc xml

comments so that much of this could be derived from the schema

document itself.

Regards

Bob

On 4 October 2012 17:25, Justin (Mohawk College) > justin.fyfe1@mohawkcollege.ca wrote:

Hello,

I was just reading the schemas posted on the github and had a question about

semantics of data in some of the fields. I assume that some fields such as

“status” will have their value drawn from a codified list of mnemonics

(categoryCode would be another). Is this a correct assumption?

If so, I had a few thoughts based on my experiences with HL7 and IHE that

might help make the semantics more obvious to future integrators.

One suggestion would be restricting the allowed values for particular fields

to a set of semantic values (this is quite restrictive and may reduce the

“permissiveness” of the schema):

<xs:element name=“status”>

<xs:simpleType >
  <xs:restriction base="xs:NCName">
    <xs:enumeration value="open">
         <xs:annotation>
             <xs:documentation>The facility is in the OPEN state which

means … </xs:documentation>

         </xs:annotation>
    </xs:enumeration>
    <xs:enumeration value="closed"/>
  </xs:restriction>
</xs:simpleType>

</xs:element>

Another option/suggestion would be using a type akin to HL7’s CX datatype

(example: 1234-5^^^LN which says code 1234-5 from LOINC) where a code and

coding scheme could be selected :

<xs:element name=“status” type=“fac:codeValue”/>

<xs:complexType name=“codeValue”>

<xs:attribute name="value" type="xs:NCName">
    <xs:annotation>
        <xs:documentation>The value of the codified

data</xs:documentation>

     </xs:annotation>
</xs:attribute>
<xs:attribute name="scheme" type="xs:anyURI">
    <xs:annotation>
        <xs:documentation>The codification scheme from which the value

was selected</xs:documentation>

     </xs:annotation>
  </xs:attribute>

</xs:complexType>

This is more permissive, closely aligned with HL7 and would allow instances

to (in the future) translate codes that are not understood locally.

Is this something that is planned to be specified at a data contract level

(XSD)? Or will it be put in the spec document? Or will it be left for

implementers to define?

IMO we should be very clear about the semantic meaning of each data element,

being permissive is great for adoption however it makes interoperability

more difficult in the long run as the specification evolves.

Thanks

-Justin

Hey Everyone,

First off, big kudos to Bob for digging right in and producing an XML spec.
It's a great start, and also great to have something tangible to sink our
teeth into.

A few very small comments:

I'm a little antsy of including something as generic as 'status' in the
facility specification document, as it begs to be misunderstood/misused.
Perhaps, in addition to linking it to a coding scheme, we could relegate
that metadata to another namespace for now (e.g. the 'extended' namespace).
Or at minimum change it to something more precise, like 'active'.

Yes I'm a bit antsy myself. I am in favour of using active.

We could change the reference to 'url's to be 'uri's, since much of the
time, particularly for internal references, these may not map to web
resources.

Yes, I suppose ... I think we should at least strongly encourage the
use of urls, but I'm not against allowing for the use of uid:xxxx or
urn:xxx if we really must. One thing that is really irritating about
the SDMX spec is that it mandates the use of urns (which are really
horrible). I can modify to allow for uris in the <url> element ...
and change its name. As long as we can agree that at least the <link>
elements, if they are present, should use urls as their semantics
really are to locate resources.

Having said that, I think the semantics of the url field is also
intended to be a resource location reference. For internal references
and the like we have the <identities> construction, which could indeed
use uri's or anything else for that matter. So on reflection I am not
sure if we need to change.

I like Bob's suggestion in the Registry API Doc of including not just the
approval date but also the approval authority, since even with a single
government there may be many different legitimate authorities. Let's also
make that a DateTime.

Please keep me posted on further discussions.

Its late here now, but I'll post a couple of changes in the morning
relating to the suggestions from you and Justin and lets see how we
look.

Thanks for taking the time to go through this.

Bob

···

On 4 October 2012 19:35, Rowena Luk <rluk@dimagi.com> wrote:

Cheers,

Rowena

On Thu, Oct 4, 2012 at 1:41 PM, Bob Jolliffe <bobjolliffe@gmail.com> wrote:

Hi Justin

Thanks for this important observation. As you have noticed, we have
kind of skirted (ignored) the issue of controlled vocabularies but I
do agree we need to address this.

The original schema that was being used in Rwanda does as you
illustrate in the first example - ie. uses a restriction in the
schema. I do agree that this "hard-coding" is not ideal and I raised
the same point in my early comments on what was being proposed there.

I would be much more in favour of something closer to your second
example. There still remains the problem of dereferencing the scheme
url to an actual codelist in a reasonably predictable way but I think
we should think about the best way to do that.

Having said all that, the samples you have looked at are not
necessarily the best illustration of this problem. In DHIS for
example we have 'status' as a binary field (true or false). The most
important purpose of this field being to easily determine whether data
coming in for a particular facility should be accepted or not. In
Rwanda they made it ternary to accomodate open, closed or planned
(hence necessitating a code list). Personally I would rather keep
this particular field binary. But that doesn't detract from your
general point.

Also categoryCode in the sample is currently in the "extended" rm
namespace so the same semantics don't necessarily need to apply, but
it is also a good candidate for what could be in the more prescriptive
facility namespace. Facility category is something we say just about
everywhere.

I do agree about the importance of absolute clarity of the semantics
of the dataelements. It certainly wasn't my intention to advocate
permissiveness here .. just that you spotted an over sight on my
behalf. I am sure there are more :slight_smile:

So lets give some thought to a way of implementing your second
suggestion which is on the one hand sufficiently flexible, and on the
other not over-burdensome on implementers.

On a more general point about specifying precise sematics of elements
and attributes, that is the purpose of the empty space currently in
the specification document. It would be a god idea to annotate the
schema properly with xs:documentation rather than my ad-hoc xml
comments so that much of this could be derived from the schema
document itself.

Regards
Bob

On 4 October 2012 17:25, Justin (Mohawk College) >> <justin.fyfe1@mohawkcollege.ca> wrote:
> Hello,
>
> I was just reading the schemas posted on the github and had a question
> about
> semantics of data in some of the fields. I assume that some fields such
> as
> "status" will have their value drawn from a codified list of mnemonics
> (categoryCode would be another). Is this a correct assumption?
>
> If so, I had a few thoughts based on my experiences with HL7 and IHE
> that
> might help make the semantics more obvious to future integrators.
>
> One suggestion would be restricting the allowed values for particular
> fields
> to a set of semantic values (this is quite restrictive and may reduce
> the
> "permissiveness" of the schema):
>
> <xs:element name="status">
> <xs:simpleType >
> <xs:restriction base="xs:NCName">
> <xs:enumeration value="open">
> <xs:annotation>
> <xs:documentation>The facility is in the OPEN state
> which
> means ... </xs:documentation>
> </xs:annotation>
> </xs:enumeration>
> <xs:enumeration value="closed"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> Another option/suggestion would be using a type akin to HL7's CX
> datatype
> (example: 1234-5^^^LN which says code 1234-5 from LOINC) where a code
> and
> coding scheme could be selected :
>
> <xs:element name="status" type="fac:codeValue"/>
> <xs:complexType name="codeValue">
> <xs:attribute name="value" type="xs:NCName">
> <xs:annotation>
> <xs:documentation>The value of the codified
> data</xs:documentation>
> </xs:annotation>
> </xs:attribute>
> <xs:attribute name="scheme" type="xs:anyURI">
> <xs:annotation>
> <xs:documentation>The codification scheme from which the
> value
> was selected</xs:documentation>
> </xs:annotation>
> </xs:attribute>
> </xs:complexType>
>
> This is more permissive, closely aligned with HL7 and would allow
> instances
> to (in the future) translate codes that are not understood locally.
>
> Is this something that is planned to be specified at a data contract
> level
> (XSD)? Or will it be put in the spec document? Or will it be left for
> implementers to define?
>
> IMO we should be very clear about the semantic meaning of each data
> element,
> being permissive is great for adoption however it makes interoperability
> more difficult in the long run as the specification evolves.
>
> Thanks
> -Justin
>
> --
>
>

--

--

Latest commit in response to Rowena's suggestion:
https://github.com/bobjolliffe/facility_reference/commit/e59194d28c0f484d7db6cb9173db63a09cbc6680

I have also changed approvalDate to type xs:date which is also my
preference though I do recall some history here. As I remember in
Rwanda they wanted this element to be able to contain a date
(2012-03-01) but also possibly just a year (2010) and maybe even a
year-month.

We could resolve this with a sort of union, but my sense is that the
date will be adequate for most use cases and the Rwanda requirement
may be a peculiarity. I can revert if people have strong feelings.
In DHIS2 this field has quite strong semantic significance as it is
used to validate data. We have openedDate rather than approvedDate,
which is roughly (though not exactly) the same thing. Data reported
for a facility in a period which is prior to the openedDate would be
viewed as suspect.

···

On 4 October 2012 19:35, Rowena Luk <rluk@dimagi.com> wrote:

Hey Everyone,

First off, big kudos to Bob for digging right in and producing an XML spec.
It's a great start, and also great to have something tangible to sink our
teeth into.

A few very small comments:

I'm a little antsy of including something as generic as 'status' in the
facility specification document, as it begs to be misunderstood/misused.
Perhaps, in addition to linking it to a coding scheme, we could relegate
that metadata to another namespace for now (e.g. the 'extended' namespace).
Or at minimum change it to something more precise, like 'active'.
We could change the reference to 'url's to be 'uri's, since much of the
time, particularly for internal references, these may not map to web
resources.
I like Bob's suggestion in the Registry API Doc of including not just the
approval date but also the approval authority, since even with a single
government there may be many different legitimate authorities. Let's also
make that a DateTime.

Please keep me posted on further discussions.

Cheers,

Rowena

On Thu, Oct 4, 2012 at 1:41 PM, Bob Jolliffe <bobjolliffe@gmail.com> wrote:

Hi Justin

Thanks for this important observation. As you have noticed, we have
kind of skirted (ignored) the issue of controlled vocabularies but I
do agree we need to address this.

The original schema that was being used in Rwanda does as you
illustrate in the first example - ie. uses a restriction in the
schema. I do agree that this "hard-coding" is not ideal and I raised
the same point in my early comments on what was being proposed there.

I would be much more in favour of something closer to your second
example. There still remains the problem of dereferencing the scheme
url to an actual codelist in a reasonably predictable way but I think
we should think about the best way to do that.

Having said all that, the samples you have looked at are not
necessarily the best illustration of this problem. In DHIS for
example we have 'status' as a binary field (true or false). The most
important purpose of this field being to easily determine whether data
coming in for a particular facility should be accepted or not. In
Rwanda they made it ternary to accomodate open, closed or planned
(hence necessitating a code list). Personally I would rather keep
this particular field binary. But that doesn't detract from your
general point.

Also categoryCode in the sample is currently in the "extended" rm
namespace so the same semantics don't necessarily need to apply, but
it is also a good candidate for what could be in the more prescriptive
facility namespace. Facility category is something we say just about
everywhere.

I do agree about the importance of absolute clarity of the semantics
of the dataelements. It certainly wasn't my intention to advocate
permissiveness here .. just that you spotted an over sight on my
behalf. I am sure there are more :slight_smile:

So lets give some thought to a way of implementing your second
suggestion which is on the one hand sufficiently flexible, and on the
other not over-burdensome on implementers.

On a more general point about specifying precise sematics of elements
and attributes, that is the purpose of the empty space currently in
the specification document. It would be a god idea to annotate the
schema properly with xs:documentation rather than my ad-hoc xml
comments so that much of this could be derived from the schema
document itself.

Regards
Bob

On 4 October 2012 17:25, Justin (Mohawk College) >> <justin.fyfe1@mohawkcollege.ca> wrote:
> Hello,
>
> I was just reading the schemas posted on the github and had a question
> about
> semantics of data in some of the fields. I assume that some fields such
> as
> "status" will have their value drawn from a codified list of mnemonics
> (categoryCode would be another). Is this a correct assumption?
>
> If so, I had a few thoughts based on my experiences with HL7 and IHE
> that
> might help make the semantics more obvious to future integrators.
>
> One suggestion would be restricting the allowed values for particular
> fields
> to a set of semantic values (this is quite restrictive and may reduce
> the
> "permissiveness" of the schema):
>
> <xs:element name="status">
> <xs:simpleType >
> <xs:restriction base="xs:NCName">
> <xs:enumeration value="open">
> <xs:annotation>
> <xs:documentation>The facility is in the OPEN state
> which
> means ... </xs:documentation>
> </xs:annotation>
> </xs:enumeration>
> <xs:enumeration value="closed"/>
> </xs:restriction>
> </xs:simpleType>
> </xs:element>
> Another option/suggestion would be using a type akin to HL7's CX
> datatype
> (example: 1234-5^^^LN which says code 1234-5 from LOINC) where a code
> and
> coding scheme could be selected :
>
> <xs:element name="status" type="fac:codeValue"/>
> <xs:complexType name="codeValue">
> <xs:attribute name="value" type="xs:NCName">
> <xs:annotation>
> <xs:documentation>The value of the codified
> data</xs:documentation>
> </xs:annotation>
> </xs:attribute>
> <xs:attribute name="scheme" type="xs:anyURI">
> <xs:annotation>
> <xs:documentation>The codification scheme from which the
> value
> was selected</xs:documentation>
> </xs:annotation>
> </xs:attribute>
> </xs:complexType>
>
> This is more permissive, closely aligned with HL7 and would allow
> instances
> to (in the future) translate codes that are not understood locally.
>
> Is this something that is planned to be specified at a data contract
> level
> (XSD)? Or will it be put in the spec document? Or will it be left for
> implementers to define?
>
> IMO we should be very clear about the semantic meaning of each data
> element,
> being permissive is great for adoption however it makes interoperability
> more difficult in the long run as the specification evolves.
>
> Thanks
> -Justin
>
> --
>
>

--

--

Hi Bob / Rowena,

I think these changes to the schema are good, so long as the group agrees they fulfill the use cases.

If I understand properly, a status of “pending” would need to be represented as an extension, however from a interoperability standpoint it would be sufficient to know the facility is not yet active:

false

<x:status xmlns:x=“urn:extension…”>pending</x:status>

Regarding date, it may be possible to fulfill the Rwanda usecase for using 2009 (any time during 2009), 2009-09 (any time during Sept. 2009) and 2009-09-09 using a restriction on xs:string which allows this, for example:

<xs:simpleType name=“extDate”>
<xs:restriction base=“xs:string”>
<xs:pattern value="^[0-9]{4}(-[0-9]{1,2})?(-[0-9]{1,2})?$"/>
</xs:restriction>
</xs:simpleType>

And then referencing the type as <xs:element name=“approvalDate” type=“fac:extDate”/>. This is similar to how the TS datatype is specified in HL7 schemas [ but don’t say that too loudly :slight_smile: ]

Cheers

-Justin

···

On Friday, October 5, 2012 5:25:40 AM UTC-4, Bob Jolliffe wrote:

Latest commit in response to Rowena’s suggestion:

https://github.com/bobjolliffe/facility_reference/commit/e59194d28c0f484d7db6cb9173db63a09cbc6680

I have also changed approvalDate to type xs:date which is also my

preference though I do recall some history here. As I remember in

Rwanda they wanted this element to be able to contain a date

(2012-03-01) but also possibly just a year (2010) and maybe even a

year-month.

We could resolve this with a sort of union, but my sense is that the

date will be adequate for most use cases and the Rwanda requirement

may be a peculiarity. I can revert if people have strong feelings.

In DHIS2 this field has quite strong semantic significance as it is

used to validate data. We have openedDate rather than approvedDate,

which is roughly (though not exactly) the same thing. Data reported

for a facility in a period which is prior to the openedDate would be

viewed as suspect.

On 4 October 2012 19:35, Rowena Luk rl...@dimagi.com wrote:

Hey Everyone,

First off, big kudos to Bob for digging right in and producing an XML spec.

It’s a great start, and also great to have something tangible to sink our

teeth into.

A few very small comments:

I’m a little antsy of including something as generic as ‘status’ in the

facility specification document, as it begs to be misunderstood/misused.

Perhaps, in addition to linking it to a coding scheme, we could relegate

that metadata to another namespace for now (e.g. the ‘extended’ namespace).

Or at minimum change it to something more precise, like ‘active’.

We could change the reference to 'url’s to be 'uri’s, since much of the

time, particularly for internal references, these may not map to web

resources.

I like Bob’s suggestion in the Registry API Doc of including not just the

approval date but also the approval authority, since even with a single

government there may be many different legitimate authorities. Let’s also

make that a DateTime.

Please keep me posted on further discussions.

Cheers,

Rowena

On Thu, Oct 4, 2012 at 1:41 PM, Bob Jolliffe bobjo...@gmail.com wrote:

Hi Justin

Thanks for this important observation. As you have noticed, we have

kind of skirted (ignored) the issue of controlled vocabularies but I

do agree we need to address this.

The original schema that was being used in Rwanda does as you

illustrate in the first example - ie. uses a restriction in the

schema. I do agree that this “hard-coding” is not ideal and I raised

the same point in my early comments on what was being proposed there.

I would be much more in favour of something closer to your second

example. There still remains the problem of dereferencing the scheme

url to an actual codelist in a reasonably predictable way but I think

we should think about the best way to do that.

Having said all that, the samples you have looked at are not

necessarily the best illustration of this problem. In DHIS for

example we have ‘status’ as a binary field (true or false). The most

important purpose of this field being to easily determine whether data

coming in for a particular facility should be accepted or not. In

Rwanda they made it ternary to accomodate open, closed or planned

(hence necessitating a code list). Personally I would rather keep

this particular field binary. But that doesn’t detract from your

general point.

Also categoryCode in the sample is currently in the “extended” rm

namespace so the same semantics don’t necessarily need to apply, but

it is also a good candidate for what could be in the more prescriptive

facility namespace. Facility category is something we say just about

everywhere.

I do agree about the importance of absolute clarity of the semantics

of the dataelements. It certainly wasn’t my intention to advocate

permissiveness here … just that you spotted an over sight on my

behalf. I am sure there are more :slight_smile:

So lets give some thought to a way of implementing your second

suggestion which is on the one hand sufficiently flexible, and on the

other not over-burdensome on implementers.

On a more general point about specifying precise sematics of elements

and attributes, that is the purpose of the empty space currently in

the specification document. It would be a god idea to annotate the

schema properly with xs:documentation rather than my ad-hoc xml

comments so that much of this could be derived from the schema

document itself.

Regards

Bob

On 4 October 2012 17:25, Justin (Mohawk College) > > >> justin...@mohawkcollege.ca wrote:

Hello,

I was just reading the schemas posted on the github and had a question

about

semantics of data in some of the fields. I assume that some fields such

as

“status” will have their value drawn from a codified list of mnemonics

(categoryCode would be another). Is this a correct assumption?

If so, I had a few thoughts based on my experiences with HL7 and IHE

that

might help make the semantics more obvious to future integrators.

One suggestion would be restricting the allowed values for particular

fields

to a set of semantic values (this is quite restrictive and may reduce

the

“permissiveness” of the schema):

<xs:element name=“status”>

<xs:simpleType >
  <xs:restriction base="xs:NCName">
    <xs:enumeration value="open">
         <xs:annotation>
             <xs:documentation>The facility is in the OPEN state

which

means … </xs:documentation>

         </xs:annotation>
    </xs:enumeration>
    <xs:enumeration value="closed"/>
  </xs:restriction>
</xs:simpleType>

</xs:element>

Another option/suggestion would be using a type akin to HL7’s CX

datatype

(example: 1234-5^^^LN which says code 1234-5 from LOINC) where a code

and

coding scheme could be selected :

<xs:element name=“status” type=“fac:codeValue”/>

<xs:complexType name=“codeValue”>

<xs:attribute name="value" type="xs:NCName">
    <xs:annotation>
        <xs:documentation>The value of the codified

data</xs:documentation>

     </xs:annotation>
</xs:attribute>
<xs:attribute name="scheme" type="xs:anyURI">
    <xs:annotation>
        <xs:documentation>The codification scheme from which the

value

was selected</xs:documentation>

     </xs:annotation>
  </xs:attribute>

</xs:complexType>

This is more permissive, closely aligned with HL7 and would allow

instances

to (in the future) translate codes that are not understood locally.

Is this something that is planned to be specified at a data contract

level

(XSD)? Or will it be put in the spec document? Or will it be left for

implementers to define?

IMO we should be very clear about the semantic meaning of each data

element,

being permissive is great for adoption however it makes interoperability

more difficult in the long run as the specification evolves.

Thanks

-Justin

Hi Bob / Rowena,

I think these changes to the schema are good, so long as the group agrees
they fulfill the use cases.

If I understand properly, a status of "pending" would need to be represented
as an extension, however from a interoperability standpoint it would be
sufficient to know the facility is not yet active:

<active>false</active>
<x:status xmlns:x="urn:extension...">pending</x:status>

Yes that is my understanding too ...

Regarding date, it may be possible to fulfill the Rwanda usecase for using
2009 (any time during 2009), 2009-09 (any time during Sept. 2009) and
2009-09-09 using a restriction on xs:string which allows this, for example:

<xs:simpleType name="extDate">
  <xs:restriction base="xs:string">
    <xs:pattern value="^[0-9]{4}(-[0-9]{1,2})?(-[0-9]{1,2})?$"/>
  </xs:restriction>
</xs:simpleType>

And then referencing the type as <xs:element name="approvalDate"
type="fac:extDate"/>. This is similar to how the TS datatype is specified in
HL7 schemas [ but don't say that too loudly :slight_smile: ]

I love regexes but I am not sure they are the best for validating
dates. The SDMX schemas (of which we'll also not speak too loudly)
also address something similar by effectively allowing a union of
standard types, something like this.

      <xs:simpleType name="extDate">
    <xs:union memberTypes="xs:dateTime xs:date xs:gYearMonth xs:gYear"/>
  </xs:simpleType>

If this is indeed the semantics we want, I suggest we do it like this.

Cheers
Bob

···

On 5 October 2012 14:42, Justin (Mohawk College) <justin.fyfe1@mohawkcollege.ca> wrote:

Cheers
-Justin

On Friday, October 5, 2012 5:25:40 AM UTC-4, Bob Jolliffe wrote:

Latest commit in response to Rowena's suggestion:

https://github.com/bobjolliffe/facility_reference/commit/e59194d28c0f484d7db6cb9173db63a09cbc6680

I have also changed approvalDate to type xs:date which is also my
preference though I do recall some history here. As I remember in
Rwanda they wanted this element to be able to contain a date
(2012-03-01) but also possibly just a year (2010) and maybe even a
year-month.

We could resolve this with a sort of union, but my sense is that the
date will be adequate for most use cases and the Rwanda requirement
may be a peculiarity. I can revert if people have strong feelings.
In DHIS2 this field has quite strong semantic significance as it is
used to validate data. We have openedDate rather than approvedDate,
which is roughly (though not exactly) the same thing. Data reported
for a facility in a period which is prior to the openedDate would be
viewed as suspect.

On 4 October 2012 19:35, Rowena Luk <rl...@dimagi.com> wrote:
> Hey Everyone,
>
> First off, big kudos to Bob for digging right in and producing an XML
> spec.
> It's a great start, and also great to have something tangible to sink
> our
> teeth into.
>
> A few very small comments:
>
> I'm a little antsy of including something as generic as 'status' in the
> facility specification document, as it begs to be misunderstood/misused.
> Perhaps, in addition to linking it to a coding scheme, we could relegate
> that metadata to another namespace for now (e.g. the 'extended'
> namespace).
> Or at minimum change it to something more precise, like 'active'.
> We could change the reference to 'url's to be 'uri's, since much of the
> time, particularly for internal references, these may not map to web
> resources.
> I like Bob's suggestion in the Registry API Doc of including not just
> the
> approval date but also the approval authority, since even with a single
> government there may be many different legitimate authorities. Let's
> also
> make that a DateTime.
>
> Please keep me posted on further discussions.
>
> Cheers,
>
> Rowena
>
>
> On Thu, Oct 4, 2012 at 1:41 PM, Bob Jolliffe <bobjo...@gmail.com> wrote:
>>
>> Hi Justin
>>
>> Thanks for this important observation. As you have noticed, we have
>> kind of skirted (ignored) the issue of controlled vocabularies but I
>> do agree we need to address this.
>>
>> The original schema that was being used in Rwanda does as you
>> illustrate in the first example - ie. uses a restriction in the
>> schema. I do agree that this "hard-coding" is not ideal and I raised
>> the same point in my early comments on what was being proposed there.
>>
>> I would be much more in favour of something closer to your second
>> example. There still remains the problem of dereferencing the scheme
>> url to an actual codelist in a reasonably predictable way but I think
>> we should think about the best way to do that.
>>
>> Having said all that, the samples you have looked at are not
>> necessarily the best illustration of this problem. In DHIS for
>> example we have 'status' as a binary field (true or false). The most
>> important purpose of this field being to easily determine whether data
>> coming in for a particular facility should be accepted or not. In
>> Rwanda they made it ternary to accomodate open, closed or planned
>> (hence necessitating a code list). Personally I would rather keep
>> this particular field binary. But that doesn't detract from your
>> general point.
>>
>> Also categoryCode in the sample is currently in the "extended" rm
>> namespace so the same semantics don't necessarily need to apply, but
>> it is also a good candidate for what could be in the more prescriptive
>> facility namespace. Facility category is something we say just about
>> everywhere.
>>
>> I do agree about the importance of absolute clarity of the semantics
>> of the dataelements. It certainly wasn't my intention to advocate
>> permissiveness here .. just that you spotted an over sight on my
>> behalf. I am sure there are more :slight_smile:
>>
>> So lets give some thought to a way of implementing your second
>> suggestion which is on the one hand sufficiently flexible, and on the
>> other not over-burdensome on implementers.
>>
>> On a more general point about specifying precise sematics of elements
>> and attributes, that is the purpose of the empty space currently in
>> the specification document. It would be a god idea to annotate the
>> schema properly with xs:documentation rather than my ad-hoc xml
>> comments so that much of this could be derived from the schema
>> document itself.
>>
>> Regards
>> Bob
>>
>> On 4 October 2012 17:25, Justin (Mohawk College) >> >> <justin...@mohawkcollege.ca> wrote:
>> > Hello,
>> >
>> > I was just reading the schemas posted on the github and had a
>> > question
>> > about
>> > semantics of data in some of the fields. I assume that some fields
>> > such
>> > as
>> > "status" will have their value drawn from a codified list of
>> > mnemonics
>> > (categoryCode would be another). Is this a correct assumption?
>> >
>> > If so, I had a few thoughts based on my experiences with HL7 and IHE
>> > that
>> > might help make the semantics more obvious to future integrators.
>> >
>> > One suggestion would be restricting the allowed values for particular
>> > fields
>> > to a set of semantic values (this is quite restrictive and may reduce
>> > the
>> > "permissiveness" of the schema):
>> >
>> > <xs:element name="status">
>> > <xs:simpleType >
>> > <xs:restriction base="xs:NCName">
>> > <xs:enumeration value="open">
>> > <xs:annotation>
>> > <xs:documentation>The facility is in the OPEN state
>> > which
>> > means ... </xs:documentation>
>> > </xs:annotation>
>> > </xs:enumeration>
>> > <xs:enumeration value="closed"/>
>> > </xs:restriction>
>> > </xs:simpleType>
>> > </xs:element>
>> > Another option/suggestion would be using a type akin to HL7's CX
>> > datatype
>> > (example: 1234-5^^^LN which says code 1234-5 from LOINC) where a code
>> > and
>> > coding scheme could be selected :
>> >
>> > <xs:element name="status" type="fac:codeValue"/>
>> > <xs:complexType name="codeValue">
>> > <xs:attribute name="value" type="xs:NCName">
>> > <xs:annotation>
>> > <xs:documentation>The value of the codified
>> > data</xs:documentation>
>> > </xs:annotation>
>> > </xs:attribute>
>> > <xs:attribute name="scheme" type="xs:anyURI">
>> > <xs:annotation>
>> > <xs:documentation>The codification scheme from which the
>> > value
>> > was selected</xs:documentation>
>> > </xs:annotation>
>> > </xs:attribute>
>> > </xs:complexType>
>> >
>> > This is more permissive, closely aligned with HL7 and would allow
>> > instances
>> > to (in the future) translate codes that are not understood locally.
>> >
>> > Is this something that is planned to be specified at a data contract
>> > level
>> > (XSD)? Or will it be put in the spec document? Or will it be left for
>> > implementers to define?
>> >
>> > IMO we should be very clear about the semantic meaning of each data
>> > element,
>> > being permissive is great for adoption however it makes
>> > interoperability
>> > more difficult in the long run as the specification evolves.
>> >
>> > Thanks
>> > -Justin
>> >
>> > --
>> >
>> >
>>
>> --
>>
>>
>
> --
>
>

--

I’d be curious to hear more about the use case in Rwanda, and how strong a need/requirement that was. If it’s not a hard requirement, I’d be in favour of sticking with the standard xs:date, for the sake of keeping the spec simple, clear, and consistent. Countries that map approval on the basis of yearly or monthly cycles could adopt some sort of internal convention to log those dates by the first or last day of those timespans.

···

On Fri, Oct 5, 2012 at 10:34 AM, Bob Jolliffe bobjolliffe@gmail.com wrote:

On 5 October 2012 14:42, Justin (Mohawk College) > justin.fyfe1@mohawkcollege.ca wrote:

Hi Bob / Rowena,

I think these changes to the schema are good, so long as the group agrees

they fulfill the use cases.

If I understand properly, a status of “pending” would need to be represented

as an extension, however from a interoperability standpoint it would be

sufficient to know the facility is not yet active:

false

<x:status xmlns:x=“urn:extension…”>pending</x:status>

Yes that is my understanding too …

Regarding date, it may be possible to fulfill the Rwanda usecase for using

2009 (any time during 2009), 2009-09 (any time during Sept. 2009) and

2009-09-09 using a restriction on xs:string which allows this, for example:

<xs:simpleType name=“extDate”>

<xs:restriction base=“xs:string”>

<xs:pattern value="^[0-9]{4}(-[0-9]{1,2})?(-[0-9]{1,2})?$"/>

</xs:restriction>

</xs:simpleType>

And then referencing the type as <xs:element name=“approvalDate”

type=“fac:extDate”/>. This is similar to how the TS datatype is specified in

HL7 schemas [ but don’t say that too loudly :slight_smile: ]

I love regexes but I am not sure they are the best for validating

dates. The SDMX schemas (of which we’ll also not speak too loudly)

also address something similar by effectively allowing a union of

standard types, something like this.

  <xs:simpleType name="extDate">

            <xs:union memberTypes="xs:dateTime xs:date xs:gYearMonth xs:gYear"/>

    </xs:simpleType>

If this is indeed the semantics we want, I suggest we do it like this.

Cheers

Bob

Cheers

-Justin

On Friday, October 5, 2012 5:25:40 AM UTC-4, Bob Jolliffe wrote:

Latest commit in response to Rowena’s suggestion:

https://github.com/bobjolliffe/facility_reference/commit/e59194d28c0f484d7db6cb9173db63a09cbc6680

I have also changed approvalDate to type xs:date which is also my

preference though I do recall some history here. As I remember in

Rwanda they wanted this element to be able to contain a date

(2012-03-01) but also possibly just a year (2010) and maybe even a

year-month.

We could resolve this with a sort of union, but my sense is that the

date will be adequate for most use cases and the Rwanda requirement

may be a peculiarity. I can revert if people have strong feelings.

In DHIS2 this field has quite strong semantic significance as it is

used to validate data. We have openedDate rather than approvedDate,

which is roughly (though not exactly) the same thing. Data reported

for a facility in a period which is prior to the openedDate would be

viewed as suspect.

On 4 October 2012 19:35, Rowena Luk rl...@dimagi.com wrote:

Hey Everyone,

First off, big kudos to Bob for digging right in and producing an XML

spec.

It’s a great start, and also great to have something tangible to sink

our

teeth into.

A few very small comments:

I’m a little antsy of including something as generic as ‘status’ in the

facility specification document, as it begs to be misunderstood/misused.

Perhaps, in addition to linking it to a coding scheme, we could relegate

that metadata to another namespace for now (e.g. the ‘extended’

namespace).

Or at minimum change it to something more precise, like ‘active’.

We could change the reference to 'url’s to be 'uri’s, since much of the

time, particularly for internal references, these may not map to web

resources.

I like Bob’s suggestion in the Registry API Doc of including not just

the

approval date but also the approval authority, since even with a single

government there may be many different legitimate authorities. Let’s

also

make that a DateTime.

Please keep me posted on further discussions.

Cheers,

Rowena

On Thu, Oct 4, 2012 at 1:41 PM, Bob Jolliffe bobjo...@gmail.com wrote:

Hi Justin

Thanks for this important observation. As you have noticed, we have

kind of skirted (ignored) the issue of controlled vocabularies but I

do agree we need to address this.

The original schema that was being used in Rwanda does as you

illustrate in the first example - ie. uses a restriction in the

schema. I do agree that this “hard-coding” is not ideal and I raised

the same point in my early comments on what was being proposed there.

I would be much more in favour of something closer to your second

example. There still remains the problem of dereferencing the scheme

url to an actual codelist in a reasonably predictable way but I think

we should think about the best way to do that.

Having said all that, the samples you have looked at are not

necessarily the best illustration of this problem. In DHIS for

example we have ‘status’ as a binary field (true or false). The most

important purpose of this field being to easily determine whether data

coming in for a particular facility should be accepted or not. In

Rwanda they made it ternary to accomodate open, closed or planned

(hence necessitating a code list). Personally I would rather keep

this particular field binary. But that doesn’t detract from your

general point.

Also categoryCode in the sample is currently in the “extended” rm

namespace so the same semantics don’t necessarily need to apply, but

it is also a good candidate for what could be in the more prescriptive

facility namespace. Facility category is something we say just about

everywhere.

I do agree about the importance of absolute clarity of the semantics

of the dataelements. It certainly wasn’t my intention to advocate

permissiveness here … just that you spotted an over sight on my

behalf. I am sure there are more :slight_smile:

So lets give some thought to a way of implementing your second

suggestion which is on the one hand sufficiently flexible, and on the

other not over-burdensome on implementers.

On a more general point about specifying precise sematics of elements

and attributes, that is the purpose of the empty space currently in

the specification document. It would be a god idea to annotate the

schema properly with xs:documentation rather than my ad-hoc xml

comments so that much of this could be derived from the schema

document itself.

Regards

Bob

On 4 October 2012 17:25, Justin (Mohawk College) > > >> >> justin...@mohawkcollege.ca wrote:

Hello,

I was just reading the schemas posted on the github and had a

question

about

semantics of data in some of the fields. I assume that some fields

such

as

“status” will have their value drawn from a codified list of

mnemonics

(categoryCode would be another). Is this a correct assumption?

If so, I had a few thoughts based on my experiences with HL7 and IHE

that

might help make the semantics more obvious to future integrators.

One suggestion would be restricting the allowed values for particular

fields

to a set of semantic values (this is quite restrictive and may reduce

the

“permissiveness” of the schema):

<xs:element name=“status”>

<xs:simpleType >
  <xs:restriction base="xs:NCName">
    <xs:enumeration value="open">
         <xs:annotation>
             <xs:documentation>The facility is in the OPEN state

which

means … </xs:documentation>

         </xs:annotation>
    </xs:enumeration>
    <xs:enumeration value="closed"/>
  </xs:restriction>
</xs:simpleType>

</xs:element>

Another option/suggestion would be using a type akin to HL7’s CX

datatype

(example: 1234-5^^^LN which says code 1234-5 from LOINC) where a code

and

coding scheme could be selected :

<xs:element name=“status” type=“fac:codeValue”/>

<xs:complexType name=“codeValue”>

<xs:attribute name="value" type="xs:NCName">
    <xs:annotation>
        <xs:documentation>The value of the codified

data</xs:documentation>

     </xs:annotation>
</xs:attribute>
<xs:attribute name="scheme" type="xs:anyURI">
    <xs:annotation>
        <xs:documentation>The codification scheme from which the

value

was selected</xs:documentation>

     </xs:annotation>
  </xs:attribute>

</xs:complexType>

This is more permissive, closely aligned with HL7 and would allow

instances

to (in the future) translate codes that are not understood locally.

Is this something that is planned to be specified at a data contract

level

(XSD)? Or will it be put in the spec document? Or will it be left for

implementers to define?

IMO we should be very clear about the semantic meaning of each data

element,

being permissive is great for adoption however it makes

interoperability

more difficult in the long run as the specification evolves.

Thanks

-Justin

I'd be curious to hear more about the use case in Rwanda, and how strong a
need/requirement that was. If it's not a hard requirement, I'd be in favour
of sticking with the standard xs:date, for the sake of keeping the spec
simple, clear, and consistent. Countries that map approval on the basis of
yearly or monthly cycles could adopt some sort of internal convention to log
those dates by the first or last day of those timespans.

Yes that is pretty much what we do in DHIS2. If we know the facility
opened in 2007 it gets logged as 2007-01-01. Which I know is not
ideal - suggesting a greater precision than you actually know to be
true, but in most cases it works well enough. Ryan and/or Mead would
have a much better background on the rationale of the RW requirement.

···

On 5 October 2012 16:19, Rowena Luk <rluk@dimagi.com> wrote:

On Fri, Oct 5, 2012 at 10:34 AM, Bob Jolliffe <bobjolliffe@gmail.com> wrote:

On 5 October 2012 14:42, Justin (Mohawk College) >> <justin.fyfe1@mohawkcollege.ca> wrote:
> Hi Bob / Rowena,
>
> I think these changes to the schema are good, so long as the group
> agrees
> they fulfill the use cases.
>
> If I understand properly, a status of "pending" would need to be
> represented
> as an extension, however from a interoperability standpoint it would be
> sufficient to know the facility is not yet active:
>
> <active>false</active>
> <x:status xmlns:x="urn:extension...">pending</x:status>

Yes that is my understanding too ...

>
> Regarding date, it may be possible to fulfill the Rwanda usecase for
> using
> 2009 (any time during 2009), 2009-09 (any time during Sept. 2009) and
> 2009-09-09 using a restriction on xs:string which allows this, for
> example:
>
> <xs:simpleType name="extDate">
> <xs:restriction base="xs:string">
> <xs:pattern value="^[0-9]{4}(-[0-9]{1,2})?(-[0-9]{1,2})?$"/>
> </xs:restriction>
> </xs:simpleType>
>
> And then referencing the type as <xs:element name="approvalDate"
> type="fac:extDate"/>. This is similar to how the TS datatype is
> specified in
> HL7 schemas [ but don't say that too loudly :slight_smile: ]

I love regexes but I am not sure they are the best for validating
dates. The SDMX schemas (of which we'll also not speak too loudly)
also address something similar by effectively allowing a union of
standard types, something like this.

      <xs:simpleType name="extDate">
                <xs:union memberTypes="xs:dateTime xs:date xs:gYearMonth
xs:gYear"/>
        </xs:simpleType>

If this is indeed the semantics we want, I suggest we do it like this.

Cheers
Bob

> Cheers
> -Justin
>
>
> On Friday, October 5, 2012 5:25:40 AM UTC-4, Bob Jolliffe wrote:
>>
>> Latest commit in response to Rowena's suggestion:
>>
>>
>> https://github.com/bobjolliffe/facility_reference/commit/e59194d28c0f484d7db6cb9173db63a09cbc6680
>>
>> I have also changed approvalDate to type xs:date which is also my
>> preference though I do recall some history here. As I remember in
>> Rwanda they wanted this element to be able to contain a date
>> (2012-03-01) but also possibly just a year (2010) and maybe even a
>> year-month.
>>
>> We could resolve this with a sort of union, but my sense is that the
>> date will be adequate for most use cases and the Rwanda requirement
>> may be a peculiarity. I can revert if people have strong feelings.
>> In DHIS2 this field has quite strong semantic significance as it is
>> used to validate data. We have openedDate rather than approvedDate,
>> which is roughly (though not exactly) the same thing. Data reported
>> for a facility in a period which is prior to the openedDate would be
>> viewed as suspect.
>>
>> On 4 October 2012 19:35, Rowena Luk <rl...@dimagi.com> wrote:
>> > Hey Everyone,
>> >
>> > First off, big kudos to Bob for digging right in and producing an XML
>> > spec.
>> > It's a great start, and also great to have something tangible to sink
>> > our
>> > teeth into.
>> >
>> > A few very small comments:
>> >
>> > I'm a little antsy of including something as generic as 'status' in
>> > the
>> > facility specification document, as it begs to be
>> > misunderstood/misused.
>> > Perhaps, in addition to linking it to a coding scheme, we could
>> > relegate
>> > that metadata to another namespace for now (e.g. the 'extended'
>> > namespace).
>> > Or at minimum change it to something more precise, like 'active'.
>> > We could change the reference to 'url's to be 'uri's, since much of
>> > the
>> > time, particularly for internal references, these may not map to web
>> > resources.
>> > I like Bob's suggestion in the Registry API Doc of including not just
>> > the
>> > approval date but also the approval authority, since even with a
>> > single
>> > government there may be many different legitimate authorities. Let's
>> > also
>> > make that a DateTime.
>> >
>> > Please keep me posted on further discussions.
>> >
>> > Cheers,
>> >
>> > Rowena
>> >
>> >
>> > On Thu, Oct 4, 2012 at 1:41 PM, Bob Jolliffe <bobjo...@gmail.com> >> >> > wrote:
>> >>
>> >> Hi Justin
>> >>
>> >> Thanks for this important observation. As you have noticed, we have
>> >> kind of skirted (ignored) the issue of controlled vocabularies but I
>> >> do agree we need to address this.
>> >>
>> >> The original schema that was being used in Rwanda does as you
>> >> illustrate in the first example - ie. uses a restriction in the
>> >> schema. I do agree that this "hard-coding" is not ideal and I
>> >> raised
>> >> the same point in my early comments on what was being proposed
>> >> there.
>> >>
>> >> I would be much more in favour of something closer to your second
>> >> example. There still remains the problem of dereferencing the
>> >> scheme
>> >> url to an actual codelist in a reasonably predictable way but I
>> >> think
>> >> we should think about the best way to do that.
>> >>
>> >> Having said all that, the samples you have looked at are not
>> >> necessarily the best illustration of this problem. In DHIS for
>> >> example we have 'status' as a binary field (true or false). The
>> >> most
>> >> important purpose of this field being to easily determine whether
>> >> data
>> >> coming in for a particular facility should be accepted or not. In
>> >> Rwanda they made it ternary to accomodate open, closed or planned
>> >> (hence necessitating a code list). Personally I would rather keep
>> >> this particular field binary. But that doesn't detract from your
>> >> general point.
>> >>
>> >> Also categoryCode in the sample is currently in the "extended" rm
>> >> namespace so the same semantics don't necessarily need to apply, but
>> >> it is also a good candidate for what could be in the more
>> >> prescriptive
>> >> facility namespace. Facility category is something we say just
>> >> about
>> >> everywhere.
>> >>
>> >> I do agree about the importance of absolute clarity of the semantics
>> >> of the dataelements. It certainly wasn't my intention to advocate
>> >> permissiveness here .. just that you spotted an over sight on my
>> >> behalf. I am sure there are more :slight_smile:
>> >>
>> >> So lets give some thought to a way of implementing your second
>> >> suggestion which is on the one hand sufficiently flexible, and on
>> >> the
>> >> other not over-burdensome on implementers.
>> >>
>> >> On a more general point about specifying precise sematics of
>> >> elements
>> >> and attributes, that is the purpose of the empty space currently in
>> >> the specification document. It would be a god idea to annotate the
>> >> schema properly with xs:documentation rather than my ad-hoc xml
>> >> comments so that much of this could be derived from the schema
>> >> document itself.
>> >>
>> >> Regards
>> >> Bob
>> >>
>> >> On 4 October 2012 17:25, Justin (Mohawk College) >> >> >> <justin...@mohawkcollege.ca> wrote:
>> >> > Hello,
>> >> >
>> >> > I was just reading the schemas posted on the github and had a
>> >> > question
>> >> > about
>> >> > semantics of data in some of the fields. I assume that some fields
>> >> > such
>> >> > as
>> >> > "status" will have their value drawn from a codified list of
>> >> > mnemonics
>> >> > (categoryCode would be another). Is this a correct assumption?
>> >> >
>> >> > If so, I had a few thoughts based on my experiences with HL7 and
>> >> > IHE
>> >> > that
>> >> > might help make the semantics more obvious to future integrators.
>> >> >
>> >> > One suggestion would be restricting the allowed values for
>> >> > particular
>> >> > fields
>> >> > to a set of semantic values (this is quite restrictive and may
>> >> > reduce
>> >> > the
>> >> > "permissiveness" of the schema):
>> >> >
>> >> > <xs:element name="status">
>> >> > <xs:simpleType >
>> >> > <xs:restriction base="xs:NCName">
>> >> > <xs:enumeration value="open">
>> >> > <xs:annotation>
>> >> > <xs:documentation>The facility is in the OPEN
>> >> > state
>> >> > which
>> >> > means ... </xs:documentation>
>> >> > </xs:annotation>
>> >> > </xs:enumeration>
>> >> > <xs:enumeration value="closed"/>
>> >> > </xs:restriction>
>> >> > </xs:simpleType>
>> >> > </xs:element>
>> >> > Another option/suggestion would be using a type akin to HL7's CX
>> >> > datatype
>> >> > (example: 1234-5^^^LN which says code 1234-5 from LOINC) where a
>> >> > code
>> >> > and
>> >> > coding scheme could be selected :
>> >> >
>> >> > <xs:element name="status" type="fac:codeValue"/>
>> >> > <xs:complexType name="codeValue">
>> >> > <xs:attribute name="value" type="xs:NCName">
>> >> > <xs:annotation>
>> >> > <xs:documentation>The value of the codified
>> >> > data</xs:documentation>
>> >> > </xs:annotation>
>> >> > </xs:attribute>
>> >> > <xs:attribute name="scheme" type="xs:anyURI">
>> >> > <xs:annotation>
>> >> > <xs:documentation>The codification scheme from which
>> >> > the
>> >> > value
>> >> > was selected</xs:documentation>
>> >> > </xs:annotation>
>> >> > </xs:attribute>
>> >> > </xs:complexType>
>> >> >
>> >> > This is more permissive, closely aligned with HL7 and would allow
>> >> > instances
>> >> > to (in the future) translate codes that are not understood
>> >> > locally.
>> >> >
>> >> > Is this something that is planned to be specified at a data
>> >> > contract
>> >> > level
>> >> > (XSD)? Or will it be put in the spec document? Or will it be left
>> >> > for
>> >> > implementers to define?
>> >> >
>> >> > IMO we should be very clear about the semantic meaning of each
>> >> > data
>> >> > element,
>> >> > being permissive is great for adoption however it makes
>> >> > interoperability
>> >> > more difficult in the long run as the specification evolves.
>> >> >
>> >> > Thanks
>> >> > -Justin
>> >> >
>> >> > --
>> >> >
>> >> >
>> >>
>> >> --
>> >>
>> >>
>> >
>> > --
>> >
>> >
>
> --
>
>

--

--

Formats such as xs:date have always been a problem in healthcare (perhaps in other settings as well.

The problem is that if you don’t have a full date, it will default to something it makes up. So, January 14, turns into January 14, at midnight. October, 2011 turns into October 1 (or October 31) 2011. This creates a host of problems. It is also why HL7 has the date/time construction that it does

Mead

···

From: facility-registry@googlegroups.com [mailto:facility-registry@googlegroups.com] On Behalf Of Rowena Luk
Sent: Friday, October 05, 2012 11:19 AM
To: facility-registry@googlegroups.com
Subject: Re: Semantics in FRED spec

I’d be curious to hear more about the use case in Rwanda, and how strong a need/requirement that was. If it’s not a hard requirement, I’d be in favour of sticking with the standard xs:date, for the sake of keeping the spec simple, clear, and consistent. Countries that map approval on the basis of yearly or monthly cycles could adopt some sort of internal convention to log those dates by the first or last day of those timespans.

On Fri, Oct 5, 2012 at 10:34 AM, Bob Jolliffe bobjolliffe@gmail.com wrote:

On 5 October 2012 14:42, Justin (Mohawk College) justin.fyfe1@mohawkcollege.ca wrote:

Hi Bob / Rowena,

I think these changes to the schema are good, so long as the group agrees
they fulfill the use cases.

If I understand properly, a status of “pending” would need to be represented
as an extension, however from a interoperability standpoint it would be
sufficient to know the facility is not yet active:

false
<x:status xmlns:x=“urn:extension…”>pending</x:status>

Yes that is my understanding too …

Regarding date, it may be possible to fulfill the Rwanda usecase for using
2009 (any time during 2009), 2009-09 (any time during Sept. 2009) and
2009-09-09 using a restriction on xs:string which allows this, for example:

<xs:simpleType name=“extDate”>
<xs:restriction base=“xs:string”>
<xs:pattern value="^[0-9]{4}(-[0-9]{1,2})?(-[0-9]{1,2})?$"/>
</xs:restriction>
</xs:simpleType>

And then referencing the type as <xs:element name=“approvalDate”
type=“fac:extDate”/>. This is similar to how the TS datatype is specified in
HL7 schemas [ but don’t say that too loudly :slight_smile: ]

I love regexes but I am not sure they are the best for validating
dates. The SDMX schemas (of which we’ll also not speak too loudly)
also address something similar by effectively allowing a union of
standard types, something like this.

  <xs:simpleType name="extDate">
            <xs:union memberTypes="xs:dateTime xs:date xs:gYearMonth xs:gYear"/>
    </xs:simpleType>

If this is indeed the semantics we want, I suggest we do it like this.

Cheers
Bob

Cheers
-Justin

On Friday, October 5, 2012 5:25:40 AM UTC-4, Bob Jolliffe wrote:

Latest commit in response to Rowena’s suggestion:

https://github.com/bobjolliffe/facility_reference/commit/e59194d28c0f484d7db6cb9173db63a09cbc6680

I have also changed approvalDate to type xs:date which is also my
preference though I do recall some history here. As I remember in
Rwanda they wanted this element to be able to contain a date
(2012-03-01) but also possibly just a year (2010) and maybe even a
year-month.

We could resolve this with a sort of union, but my sense is that the
date will be adequate for most use cases and the Rwanda requirement
may be a peculiarity. I can revert if people have strong feelings.
In DHIS2 this field has quite strong semantic significance as it is
used to validate data. We have openedDate rather than approvedDate,
which is roughly (though not exactly) the same thing. Data reported
for a facility in a period which is prior to the openedDate would be
viewed as suspect.

On 4 October 2012 19:35, Rowena Luk rl...@dimagi.com wrote:

Hey Everyone,

First off, big kudos to Bob for digging right in and producing an XML
spec.
It’s a great start, and also great to have something tangible to sink
our
teeth into.

A few very small comments:

I’m a little antsy of including something as generic as ‘status’ in the
facility specification document, as it begs to be misunderstood/misused.
Perhaps, in addition to linking it to a coding scheme, we could relegate
that metadata to another namespace for now (e.g. the ‘extended’
namespace).
Or at minimum change it to something more precise, like ‘active’.
We could change the reference to 'url’s to be 'uri’s, since much of the
time, particularly for internal references, these may not map to web
resources.
I like Bob’s suggestion in the Registry API Doc of including not just
the
approval date but also the approval authority, since even with a single
government there may be many different legitimate authorities. Let’s
also
make that a DateTime.

Please keep me posted on further discussions.

Cheers,

Rowena

On Thu, Oct 4, 2012 at 1:41 PM, Bob Jolliffe bobjo...@gmail.com wrote:

Hi Justin

Thanks for this important observation. As you have noticed, we have
kind of skirted (ignored) the issue of controlled vocabularies but I
do agree we need to address this.

The original schema that was being used in Rwanda does as you
illustrate in the first example - ie. uses a restriction in the
schema. I do agree that this “hard-coding” is not ideal and I raised
the same point in my early comments on what was being proposed there.

I would be much more in favour of something closer to your second
example. There still remains the problem of dereferencing the scheme
url to an actual codelist in a reasonably predictable way but I think
we should think about the best way to do that.

Having said all that, the samples you have looked at are not
necessarily the best illustration of this problem. In DHIS for
example we have ‘status’ as a binary field (true or false). The most
important purpose of this field being to easily determine whether data
coming in for a particular facility should be accepted or not. In
Rwanda they made it ternary to accomodate open, closed or planned
(hence necessitating a code list). Personally I would rather keep
this particular field binary. But that doesn’t detract from your
general point.

Also categoryCode in the sample is currently in the “extended” rm
namespace so the same semantics don’t necessarily need to apply, but
it is also a good candidate for what could be in the more prescriptive
facility namespace. Facility category is something we say just about
everywhere.

I do agree about the importance of absolute clarity of the semantics
of the dataelements. It certainly wasn’t my intention to advocate
permissiveness here … just that you spotted an over sight on my
behalf. I am sure there are more :slight_smile:

So lets give some thought to a way of implementing your second
suggestion which is on the one hand sufficiently flexible, and on the
other not over-burdensome on implementers.

On a more general point about specifying precise sematics of elements
and attributes, that is the purpose of the empty space currently in
the specification document. It would be a god idea to annotate the
schema properly with xs:documentation rather than my ad-hoc xml
comments so that much of this could be derived from the schema
document itself.

Regards
Bob

On 4 October 2012 17:25, Justin (Mohawk College) >> >> justin...@mohawkcollege.ca wrote:

Hello,

I was just reading the schemas posted on the github and had a
question
about
semantics of data in some of the fields. I assume that some fields
such
as
“status” will have their value drawn from a codified list of
mnemonics
(categoryCode would be another). Is this a correct assumption?

If so, I had a few thoughts based on my experiences with HL7 and IHE
that
might help make the semantics more obvious to future integrators.

One suggestion would be restricting the allowed values for particular
fields
to a set of semantic values (this is quite restrictive and may reduce
the
“permissiveness” of the schema):

<xs:element name=“status”>
<xs:simpleType >
<xs:restriction base=“xs:NCName”>
<xs:enumeration value=“open”>
xs:annotation
xs:documentationThe facility is in the OPEN state
which
means … </xs:documentation>
</xs:annotation>
</xs:enumeration>
<xs:enumeration value=“closed”/>
</xs:restriction>
</xs:simpleType>
</xs:element>
Another option/suggestion would be using a type akin to HL7’s CX
datatype
(example: 1234-5^^^LN which says code 1234-5 from LOINC) where a code
and
coding scheme could be selected :

<xs:element name=“status” type=“fac:codeValue”/>
<xs:complexType name=“codeValue”>
<xs:attribute name=“value” type=“xs:NCName”>
xs:annotation
xs:documentationThe value of the codified
data</xs:documentation>
</xs:annotation>
</xs:attribute>
<xs:attribute name=“scheme” type=“xs:anyURI”>
xs:annotation
xs:documentationThe codification scheme from which the
value
was selected</xs:documentation>
</xs:annotation>
</xs:attribute>
</xs:complexType>

This is more permissive, closely aligned with HL7 and would allow
instances
to (in the future) translate codes that are not understood locally.

Is this something that is planned to be specified at a data contract
level
(XSD)? Or will it be put in the spec document? Or will it be left for
implementers to define?

IMO we should be very clear about the semantic meaning of each data
element,
being permissive is great for adoption however it makes
interoperability
more difficult in the long run as the specification evolves.

Thanks
-Justin

Hi Mead

Agree that times and dates are always a can of worms. With routine
reporting we have huge difficulties with weekly periods (everyone has
a different idea about the first day of the first week of the year),
financial year reporting and whether folk choose to look at the moon
(Islamic calendar) or the the sun to mark the passage of time.

This case is hopefully simpler ...

What we really need to get to, as Rowena is suggesting, is what users
will really use this <openingDate> for. If it is just for informative
display then it doesn't really matter (too much) what we put in it.
If it will be used in computations, eg. which facilities opened in
this period, then it is better to store a date in the backend
database, even if the user interface allows the entering of just
'2007'. Allowing for a union of different representations just puts
off the eventual resolution to a date till later.

But I don't have a really strong view on it. Except that I would use
the union type I referred to earlier rather than a regex. And unless
there is a compelling requirement for the extra complexity I'd favour
a simple date type for opening date.

Bob

···

On 5 October 2012 18:20, Mead Walker <dmead@comcast.net> wrote:

Formats such as xs:date have always been a problem in healthcare (perhaps in
other settings as well.

The problem is that if you don’t have a full date, it will default to
something it makes up. So, January 14, turns into January 14, at midnight.
October, 2011 turns into October 1 (or October 31) 2011. This creates a
host of problems. It is also why HL7 has the date/time construction that it
does

Mead

From: facility-registry@googlegroups.com
[mailto:facility-registry@googlegroups.com] On Behalf Of Rowena Luk
Sent: Friday, October 05, 2012 11:19 AM

To: facility-registry@googlegroups.com
Subject: Re: Semantics in FRED spec

I'd be curious to hear more about the use case in Rwanda, and how strong a
need/requirement that was. If it's not a hard requirement, I'd be in favour
of sticking with the standard xs:date, for the sake of keeping the spec
simple, clear, and consistent. Countries that map approval on the basis of
yearly or monthly cycles could adopt some sort of internal convention to log
those dates by the first or last day of those timespans.

On Fri, Oct 5, 2012 at 10:34 AM, Bob Jolliffe <bobjolliffe@gmail.com> wrote:

On 5 October 2012 14:42, Justin (Mohawk College) > > <justin.fyfe1@mohawkcollege.ca> wrote:

Hi Bob / Rowena,

I think these changes to the schema are good, so long as the group agrees
they fulfill the use cases.

If I understand properly, a status of "pending" would need to be
represented
as an extension, however from a interoperability standpoint it would be
sufficient to know the facility is not yet active:

<active>false</active>
<x:status xmlns:x="urn:extension...">pending</x:status>

Yes that is my understanding too ...

Regarding date, it may be possible to fulfill the Rwanda usecase for using
2009 (any time during 2009), 2009-09 (any time during Sept. 2009) and
2009-09-09 using a restriction on xs:string which allows this, for
example:

<xs:simpleType name="extDate">
  <xs:restriction base="xs:string">
    <xs:pattern value="^[0-9]{4}(-[0-9]{1,2})?(-[0-9]{1,2})?$"/>
  </xs:restriction>
</xs:simpleType>

And then referencing the type as <xs:element name="approvalDate"
type="fac:extDate"/>. This is similar to how the TS datatype is specified
in
HL7 schemas [ but don't say that too loudly :slight_smile: ]

I love regexes but I am not sure they are the best for validating
dates. The SDMX schemas (of which we'll also not speak too loudly)
also address something similar by effectively allowing a union of
standard types, something like this.

      <xs:simpleType name="extDate">
                <xs:union memberTypes="xs:dateTime xs:date xs:gYearMonth
xs:gYear"/>
        </xs:simpleType>

If this is indeed the semantics we want, I suggest we do it like this.

Cheers
Bob

Cheers
-Justin

On Friday, October 5, 2012 5:25:40 AM UTC-4, Bob Jolliffe wrote:

Latest commit in response to Rowena's suggestion:

https://github.com/bobjolliffe/facility_reference/commit/e59194d28c0f484d7db6cb9173db63a09cbc6680

I have also changed approvalDate to type xs:date which is also my
preference though I do recall some history here. As I remember in
Rwanda they wanted this element to be able to contain a date
(2012-03-01) but also possibly just a year (2010) and maybe even a
year-month.

We could resolve this with a sort of union, but my sense is that the
date will be adequate for most use cases and the Rwanda requirement
may be a peculiarity. I can revert if people have strong feelings.
In DHIS2 this field has quite strong semantic significance as it is
used to validate data. We have openedDate rather than approvedDate,
which is roughly (though not exactly) the same thing. Data reported
for a facility in a period which is prior to the openedDate would be
viewed as suspect.

On 4 October 2012 19:35, Rowena Luk <rl...@dimagi.com> wrote:
> Hey Everyone,
>
> First off, big kudos to Bob for digging right in and producing an XML
> spec.
> It's a great start, and also great to have something tangible to sink
> our
> teeth into.
>
> A few very small comments:
>
> I'm a little antsy of including something as generic as 'status' in the
> facility specification document, as it begs to be
> misunderstood/misused.
> Perhaps, in addition to linking it to a coding scheme, we could
> relegate
> that metadata to another namespace for now (e.g. the 'extended'
> namespace).
> Or at minimum change it to something more precise, like 'active'.
> We could change the reference to 'url's to be 'uri's, since much of the
> time, particularly for internal references, these may not map to web
> resources.
> I like Bob's suggestion in the Registry API Doc of including not just
> the
> approval date but also the approval authority, since even with a single
> government there may be many different legitimate authorities. Let's
> also
> make that a DateTime.
>
> Please keep me posted on further discussions.
>
> Cheers,
>
> Rowena
>
>
> On Thu, Oct 4, 2012 at 1:41 PM, Bob Jolliffe <bobjo...@gmail.com> >>> > wrote:
>>
>> Hi Justin
>>
>> Thanks for this important observation. As you have noticed, we have
>> kind of skirted (ignored) the issue of controlled vocabularies but I
>> do agree we need to address this.
>>
>> The original schema that was being used in Rwanda does as you
>> illustrate in the first example - ie. uses a restriction in the
>> schema. I do agree that this "hard-coding" is not ideal and I raised
>> the same point in my early comments on what was being proposed there.
>>
>> I would be much more in favour of something closer to your second
>> example. There still remains the problem of dereferencing the scheme
>> url to an actual codelist in a reasonably predictable way but I think
>> we should think about the best way to do that.
>>
>> Having said all that, the samples you have looked at are not
>> necessarily the best illustration of this problem. In DHIS for
>> example we have 'status' as a binary field (true or false). The most
>> important purpose of this field being to easily determine whether data
>> coming in for a particular facility should be accepted or not. In
>> Rwanda they made it ternary to accomodate open, closed or planned
>> (hence necessitating a code list). Personally I would rather keep
>> this particular field binary. But that doesn't detract from your
>> general point.
>>
>> Also categoryCode in the sample is currently in the "extended" rm
>> namespace so the same semantics don't necessarily need to apply, but
>> it is also a good candidate for what could be in the more prescriptive
>> facility namespace. Facility category is something we say just about
>> everywhere.
>>
>> I do agree about the importance of absolute clarity of the semantics
>> of the dataelements. It certainly wasn't my intention to advocate
>> permissiveness here .. just that you spotted an over sight on my
>> behalf. I am sure there are more :slight_smile:
>>
>> So lets give some thought to a way of implementing your second
>> suggestion which is on the one hand sufficiently flexible, and on the
>> other not over-burdensome on implementers.
>>
>> On a more general point about specifying precise sematics of elements
>> and attributes, that is the purpose of the empty space currently in
>> the specification document. It would be a god idea to annotate the
>> schema properly with xs:documentation rather than my ad-hoc xml
>> comments so that much of this could be derived from the schema
>> document itself.
>>
>> Regards
>> Bob
>>
>> On 4 October 2012 17:25, Justin (Mohawk College) >>> >> <justin...@mohawkcollege.ca> wrote:
>> > Hello,
>> >
>> > I was just reading the schemas posted on the github and had a
>> > question
>> > about
>> > semantics of data in some of the fields. I assume that some fields
>> > such
>> > as
>> > "status" will have their value drawn from a codified list of
>> > mnemonics
>> > (categoryCode would be another). Is this a correct assumption?
>> >
>> > If so, I had a few thoughts based on my experiences with HL7 and IHE
>> > that
>> > might help make the semantics more obvious to future integrators.
>> >
>> > One suggestion would be restricting the allowed values for
>> > particular
>> > fields
>> > to a set of semantic values (this is quite restrictive and may
>> > reduce
>> > the
>> > "permissiveness" of the schema):
>> >
>> > <xs:element name="status">
>> > <xs:simpleType >
>> > <xs:restriction base="xs:NCName">
>> > <xs:enumeration value="open">
>> > <xs:annotation>
>> > <xs:documentation>The facility is in the OPEN state
>> > which
>> > means ... </xs:documentation>
>> > </xs:annotation>
>> > </xs:enumeration>
>> > <xs:enumeration value="closed"/>
>> > </xs:restriction>
>> > </xs:simpleType>
>> > </xs:element>
>> > Another option/suggestion would be using a type akin to HL7's CX
>> > datatype
>> > (example: 1234-5^^^LN which says code 1234-5 from LOINC) where a
>> > code
>> > and
>> > coding scheme could be selected :
>> >
>> > <xs:element name="status" type="fac:codeValue"/>
>> > <xs:complexType name="codeValue">
>> > <xs:attribute name="value" type="xs:NCName">
>> > <xs:annotation>
>> > <xs:documentation>The value of the codified
>> > data</xs:documentation>
>> > </xs:annotation>
>> > </xs:attribute>
>> > <xs:attribute name="scheme" type="xs:anyURI">
>> > <xs:annotation>
>> > <xs:documentation>The codification scheme from which the
>> > value
>> > was selected</xs:documentation>
>> > </xs:annotation>
>> > </xs:attribute>
>> > </xs:complexType>
>> >
>> > This is more permissive, closely aligned with HL7 and would allow
>> > instances
>> > to (in the future) translate codes that are not understood locally.
>> >
>> > Is this something that is planned to be specified at a data contract
>> > level
>> > (XSD)? Or will it be put in the spec document? Or will it be left
>> > for
>> > implementers to define?
>> >
>> > IMO we should be very clear about the semantic meaning of each data
>> > element,
>> > being permissive is great for adoption however it makes
>> > interoperability
>> > more difficult in the long run as the specification evolves.
>> >
>> > Thanks
>> > -Justin
>> >
>> > --
>> >
>> >
>>
>> --
>>
>>
>
> --
>
>

--

--

--

--

Hi All,

I have been following this discussion with interest and have actually follow up with some people involved in using Facility registries. I have syntheses them into this response.

On the Date, having at least the Month/Year would be preferable of just the year, The reason is when linking to existing datasets you can confirm if the link is correct based on the only having data after the facility was open. In number of countries (Ethiopia come to mind) they have been opening facilities (then closing some) at a rapid rate, thus just having the year is not enough. Therefore, I would suggest that at least having month and year. I understand the issue that this creates so if that means have the day/month/year that is preferable to just the year.

On the Approval Date, some facilities are not operating with approval pending, in Kenya there some major facilities have been operating (for years) still waiting for approval of their registration therefore i might worth change it to operational date. Just a suggestion.

On the Status and Active, Active is a better binary field. I would suggest that we look at adding Status into the Optional section, this is very is a very useful field in particular when linking it to existing data and managing the list.

Looking on the Optional sections, i understand the reason that we don’t want to be too prescriptive, however, instead referring to them as “Optional” but as “Highly Recommended”.

in managing health facilities lists have the “Agency”, and an additional field called “Type” are very useful in managing and linking existing datasets.

On current optional area is “agency” I am assume is “owner” - Government, Private, FBO, NGO in Kenya and Tanzania it was both very useful in validating linking existing dataset together and in managing the list of facilities in Kenya. The reason was that it this help identify matches and when managing it helped Disitrict Health Offices in Kenya in identify and ensuring that the exact number facilitie sin the district were known and how many were government vs non-government. Not knowing this distinction lead to confusion on the exact number of facilities as people would include and exclude sites based what they thought facility was, having this classification in the registry gave clarity.

Facility “Type” again is very useful when linking existing dataset and in managing the list of facilities, it was useful in Kenya, Tanzania, Zambia, Nigeria, Ghana and Rwanda. The reason being that when linking existing data been able to differentiate ate by type was very useful in validating linkages. In some cases their would two to three sites with the same name but were different types. Also, the type was not always in the name, secondly some sites changed type but did not change their name thus the name lead to confusion thus in managing the list know the type became very important.

On the Geo.xsd

I would also suggest adding two elements;

Setting the number decimal places to at least 4 decimal places. if you have less than that then the accuracy of the location is limited and it hard to differentiate if you have two sites next to one another or are the same site just know by different names. This is a common occurrence in some countries where it has name such as St Joseph Hospital but is also know as FRED District Hospital. Thus having the data at least to the 4 decimal point will help in managing the data quality if the coordinates and identifying duplicates.

I would also suggest adding a field called “Accuracy” which describes the accuracy of the coordinates either as - “GPS”, “Detail Map” “Gazetted” or “Unknown”. In Rwanda it was very fortunate that the government had geocoded a large number of the sites. in other countries this is not the case where the geocodes come from a number of difference sources with different level of accuracy. Therefore, i would suggest the addition of this field if the plan is expand its other countries. It would also help the in the management in to where cooridates to be updated.

I have included a link to a publication under the USAID|DELIVER PROJECT that describes this in greater detail http://www.deliver.jsi.com/dlvr_content/resources/allpubs/guidelines/GuidLinkLogDat_GIS.pdf

I hope this is useful feedback.

Andrew Inglis
GIS Team Leader

John Snow, Inc.
USAID | DELIVER PROJECT
1616 Fort Myer Drive
11th Floor
Arlington, VA 22209
(703) 528-7474 ext. 5270
andrew_inglis@jsi.com
Learn about JSI at: www.jsi.com

···

On Tuesday, October 9, 2012, Bob Jolliffe wrote:

Hi Mead

Agree that times and dates are always a can of worms. With routine

reporting we have huge difficulties with weekly periods (everyone has

a different idea about the first day of the first week of the year),

financial year reporting and whether folk choose to look at the moon

(Islamic calendar) or the the sun to mark the passage of time.

This case is hopefully simpler …

What we really need to get to, as Rowena is suggesting, is what users

will really use this for. If it is just for informative

display then it doesn’t really matter (too much) what we put in it.

If it will be used in computations, eg. which facilities opened in

this period, then it is better to store a date in the backend

database, even if the user interface allows the entering of just

‘2007’. Allowing for a union of different representations just puts

off the eventual resolution to a date till later.

But I don’t have a really strong view on it. Except that I would use

the union type I referred to earlier rather than a regex. And unless

there is a compelling requirement for the extra complexity I’d favour

a simple date type for opening date.

Bob

On 5 October 2012 18:20, Mead Walker dmead@comcast.net wrote:

Formats such as xs:date have always been a problem in healthcare (perhaps in

other settings as well.

The problem is that if you don’t have a full date, it will default to

something it makes up. So, January 14, turns into January 14, at midnight.

October, 2011 turns into October 1 (or October 31) 2011. This creates a

host of problems. It is also why HL7 has the date/time construction that it

does

Mead

From: facility-registry@googlegroups.com

[mailto:facility-registry@googlegroups.com] On Behalf Of Rowena Luk

Sent: Friday, October 05, 2012 11:19 AM

To: facility-registry@googlegroups.com

Subject: Re: Semantics in FRED spec

I’d be curious to hear more about the use case in Rwanda, and how strong a

need/requirement that was. If it’s not a hard requirement, I’d be in favour

of sticking with the standard xs:date, for the sake of keeping the spec

simple, clear, and consistent. Countries that map approval on the basis of

yearly or monthly cycles could adopt some sort of internal convention to log

those dates by the first or last day of those timespans.

On Fri, Oct 5, 2012 at 10:34 AM, Bob Jolliffe bobjolliffe@gmail.com wrote:

On 5 October 2012 14:42, Justin (Mohawk College) > > > > > > justin.fyfe1@mohawkcollege.ca wrote:

Hi Bob / Rowena,

I think these changes to the schema are good, so long as the group agrees

they fulfill the use cases.

If I understand properly, a status of “pending” would need to be

represented

as an extension, however from a interoperability standpoint it would be

sufficient to know the facility is not yet active:

false

<x:status xmlns:x=“urn:extension…”>pending</x:status>

Yes that is my understanding too …

Regarding date, it may be possible to fulfill the Rwanda usecase for using

2009 (any time during 2009), 2009-09 (any time during Sept. 2009) and

2009-09-09 using a restriction on xs:string which allows this, for

example:

<xs:simpleType name=“extDate”>

<xs:restriction base=“xs:string”>

<xs:pattern value="^[0-9]{4}(-[0-9]{1,2})?(-[0-9]{1,2})?$"/>

</xs:restriction>

</xs:simpleType>

And then referencing the type as <xs:element name=“approvalDate”

type=“fac:extDate”/>. This is similar to how the TS datatype is specified

in

HL7 schemas [ but don’t say that too loudly :slight_smile: ]

I love regexes but I am not sure they are the best for validating

dates. The SDMX schemas (of which we’ll also not speak too loudly)

also address something similar by effectively allowing a union of

standard types, something like this.

  <xs:simpleType name="extDate">
            <xs:union memberTypes="xs:dateTime xs:date xs:gYearMonth

xs:gYear"/>

    </xs:simpleType>

If this is indeed the semantics we want, I suggest we do it like this.

Cheers

Bob

Cheers

-Justin

On Friday, October 5, 2012 5:25:40 AM UTC-4, Bob Jolliffe wrote:

Latest commit in response to Rowena’s suggestion:


Andrew Inglis

Thanks Andrew for this great feedback! I'll take some time to digest,
but I think all of the points you raise are valid. I'm particularly
thinking about how best to deal with "optional" elements and how they
might be mandatory when dealing with different classes of conformance.

···

On 9 October 2012 23:16, Andrew Inglis <andrew.d.inglis@gmail.com> wrote:

Hi All,

I have been following this discussion with interest and have actually follow
up with some people involved in using Facility registries. I have syntheses
them into this response.

On the Date, having at least the Month/Year would be preferable of just the
year, The reason is when linking to existing datasets you can confirm if
the link is correct based on the only having data after the facility was
open. In number of countries (Ethiopia come to mind) they have been opening
facilities (then closing some) at a rapid rate, thus just having the year is
not enough. Therefore, I would suggest that at least having month and
year. I understand the issue that this creates so if that means have the
day/month/year that is preferable to just the year.

On the Approval Date, some facilities are not operating with approval
pending, in Kenya there some major facilities have been operating (for
years) still waiting for approval of their registration therefore i might
worth change it to operational date. Just a suggestion.

On the Status and Active, Active is a better binary field. I would suggest
that we look at adding Status into the Optional section, this is very is a
very useful field in particular when linking it to existing data and
managing the list.

Looking on the Optional sections, i understand the reason that we don't want
to be too prescriptive, however, instead referring to them as "Optional" but
as "Highly Recommended".

in managing health facilities lists have the "Agency", and an additional
field called "Type" are very useful in managing and linking existing
datasets.

On current optional area is "agency" I am assume is "owner" - Government,
Private, FBO, NGO in Kenya and Tanzania it was both very useful in
validating linking existing dataset together and in managing the list of
facilities in Kenya. The reason was that it this help identify matches and
when managing it helped Disitrict Health Offices in Kenya in identify and
ensuring that the exact number facilitie sin the district were known and how
many were government vs non-government. Not knowing this distinction lead
to confusion on the exact number of facilities as people would include and
exclude sites based what they thought facility was, having this
classification in the registry gave clarity.

Facility "Type" again is very useful when linking existing dataset and in
managing the list of facilities, it was useful in Kenya, Tanzania, Zambia,
Nigeria, Ghana and Rwanda. The reason being that when linking existing data
been able to differentiate ate by type was very useful in validating
linkages. In some cases their would two to three sites with the same name
but were different types. Also, the type was not always in the name,
secondly some sites changed type but did not change their name thus the name
lead to confusion thus in managing the list know the type became very
important.

On the Geo.xsd

I would also suggest adding two elements;

Setting the number decimal places to at least 4 decimal places. if you have
less than that then the accuracy of the location is limited and it hard to
differentiate if you have two sites next to one another or are the same site
just know by different names. This is a common occurrence in some countries
where it has name such as St Joseph Hospital but is also know as FRED
District Hospital. Thus having the data at least to the 4 decimal point
will help in managing the data quality if the coordinates and identifying
duplicates.

I would also suggest adding a field called "Accuracy" which describes the
accuracy of the coordinates either as - "GPS", "Detail Map" "Gazetted" or
"Unknown". In Rwanda it was very fortunate that the government had geocoded
a large number of the sites. in other countries this is not the case where
the geocodes come from a number of difference sources with different level
of accuracy. Therefore, i would suggest the addition of this field if the
plan is expand its other countries. It would also help the in the
management in to where cooridates to be updated.

I have included a link to a publication under the USAID|DELIVER PROJECT that
describes this in greater detail
http://www.deliver.jsi.com/dlvr_content/resources/allpubs/guidelines/GuidLinkLogDat_GIS.pdf

I hope this is useful feedback.

Andrew Inglis
GIS Team Leader
John Snow, Inc.
USAID | DELIVER PROJECT
1616 Fort Myer Drive
11th Floor
Arlington, VA 22209
(703) 528-7474 ext. 5270
andrew_inglis@jsi.com
Learn about JSI at: www.jsi.com

On Tuesday, October 9, 2012, Bob Jolliffe wrote:

Hi Mead

Agree that times and dates are always a can of worms. With routine
reporting we have huge difficulties with weekly periods (everyone has
a different idea about the first day of the first week of the year),
financial year reporting and whether folk choose to look at the moon
(Islamic calendar) or the the sun to mark the passage of time.

This case is hopefully simpler ...

What we really need to get to, as Rowena is suggesting, is what users
will really use this <openingDate> for. If it is just for informative
display then it doesn't really matter (too much) what we put in it.
If it will be used in computations, eg. which facilities opened in
this period, then it is better to store a date in the backend
database, even if the user interface allows the entering of just
'2007'. Allowing for a union of different representations just puts
off the eventual resolution to a date till later.

But I don't have a really strong view on it. Except that I would use
the union type I referred to earlier rather than a regex. And unless
there is a compelling requirement for the extra complexity I'd favour
a simple date type for opening date.

Bob

On 5 October 2012 18:20, Mead Walker <dmead@comcast.net> wrote:
> Formats such as xs:date have always been a problem in healthcare
> (perhaps in
> other settings as well.
>
>
>
> The problem is that if you don’t have a full date, it will default to
> something it makes up. So, January 14, turns into January 14, at
> midnight.
> October, 2011 turns into October 1 (or October 31) 2011. This creates a
> host of problems. It is also why HL7 has the date/time construction
> that it
> does
>
>
>
> Mead
>
>
>
> From: facility-registry@googlegroups.com
> [mailto:facility-registry@googlegroups.com] On Behalf Of Rowena Luk
> Sent: Friday, October 05, 2012 11:19 AM
>
>
> To: facility-registry@googlegroups.com
> Subject: Re: Semantics in FRED spec
>
>
>
> I'd be curious to hear more about the use case in Rwanda, and how strong
> a
> need/requirement that was. If it's not a hard requirement, I'd be in
> favour
> of sticking with the standard xs:date, for the sake of keeping the spec
> simple, clear, and consistent. Countries that map approval on the basis
> of
> yearly or monthly cycles could adopt some sort of internal convention to
> log
> those dates by the first or last day of those timespans.
>
> On Fri, Oct 5, 2012 at 10:34 AM, Bob Jolliffe <bobjolliffe@gmail.com> >> > wrote:
>
> On 5 October 2012 14:42, Justin (Mohawk College) >> > >> > <justin.fyfe1@mohawkcollege.ca> wrote:
>> Hi Bob / Rowena,
>>
>> I think these changes to the schema are good, so long as the group
>> agrees
>> they fulfill the use cases.
>>
>> If I understand properly, a status of "pending" would need to be
>> represented
>> as an extension, however from a interoperability standpoint it would be
>> sufficient to know the facility is not yet active:
>>
>> <active>false</active>
>> <x:status xmlns:x="urn:extension...">pending</x:status>
>
> Yes that is my understanding too ...
>
>
>>
>> Regarding date, it may be possible to fulfill the Rwanda usecase for
>> using
>> 2009 (any time during 2009), 2009-09 (any time during Sept. 2009) and
>> 2009-09-09 using a restriction on xs:string which allows this, for
>> example:
>>
>> <xs:simpleType name="extDate">
>> <xs:restriction base="xs:string">
>> <xs:pattern value="^[0-9]{4}(-[0-9]{1,2})?(-[0-9]{1,2})?$"/>
>> </xs:restriction>
>> </xs:simpleType>
>>
>> And then referencing the type as <xs:element name="approvalDate"
>> type="fac:extDate"/>. This is similar to how the TS datatype is
>> specified
>> in
>> HL7 schemas [ but don't say that too loudly :slight_smile: ]
>
> I love regexes but I am not sure they are the best for validating
> dates. The SDMX schemas (of which we'll also not speak too loudly)
> also address something similar by effectively allowing a union of
> standard types, something like this.
>
> <xs:simpleType name="extDate">
> <xs:union memberTypes="xs:dateTime xs:date xs:gYearMonth
> xs:gYear"/>
> </xs:simpleType>
>
> If this is indeed the semantics we want, I suggest we do it like this.
>
> Cheers
> Bob
>
>
>> Cheers
>> -Justin
>>
>>
>> On Friday, October 5, 2012 5:25:40 AM UTC-4, Bob Jolliffe wrote:
>>>
>>> Latest commit in response to Rowena's suggestion:
>>>
>>>
>>> --

--
Andrew Inglis

--

It appears that I have opened a can of worms so to speak :wink: I haven't had time to dive too deeply into the comments but here are some first reactions I have.

First, I think that date precision is one of the hanging points here. Mead alluded to this and it becomes important when implementing in Java/C# when dates are processed as DateTime or Calendar objects; it becomes impossible to determine the actual precision. HL7 handles this by representing a partial date (200909 for September 2009), however I think that this has some repercussions in terms of formatting and actually implementing (i.e. code generators will expose this as a String which isn't helpful IMO).

Also, I think Andrew touched on some business cases where some fields might be restricted to month (sorry if I misunderstood your commentary I haven't dived into deep thought about it), however I would like to stay away from restricting all dates to be precise to the month (but still allow this business case).

I see FRED as a messaging specification (+ reference implementation). I think we need to clearly define the difference between what is conveyed on the wire and what responsibility exists to store/reproduce the data. IMO consumers should merely be able to convey a precision based on their current dataset, user interface, or other factors and don't need to store the precision. For example, if an end-user program has UI with a calendar drop-down then it should convey it captured the date precise to the day, whereas another program with a year/month drop-down should convey the month precision. It doesn't matter how it is stored in their internal database. The FRED service implementers however do need to be aware of this precision and must be capable of regurgitating it.

My dream would be a common type definition that can be used for all dates/times that is consistent no matter what date data is being represented (opening date, approval date, or whatever dates we put into the messages in the future) and will allow any precision (HL7's TS is good at this however as I mentioned before there are repercussions of using that structure). What I'd like to have is some verbiage like this in the final API text (this is just a sample, I don't expect this will be the final solution we create):

---------------- FRED API.DOC ----------------
**Dates**

Dates and times are described in the FRED API using one of the following types: fac:simpleDate or fac:complexDate defined in Figure X.

Figure X - Schema for dates
  <xs:simpleType name="simpleDate">
    <xs:union memberTypes="xs:date xs:dateTime xs:time">
    </xs:union>
  </xs:simpleType>

  <xs:complexType name="complexDate">
    <xs:simpleContent>
      <xs:extension base="simpleDate">
        <xs:attribute name="offset">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="D"/>
              <xs:enumeration value="M"/>
              <xs:enumeration value="Y"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:attribute>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
End Figure X

These two types are used based on the following conditions:

fac:simpleDate (default) represents a union of xs:date, xs:dateTime and xs:time whereby the value reported in the instance represents the full precision of data:
        <!-- Known to have occurred on September 1 2012 -->
        <approvalDate>2012-09-01</approvalDate>
        <!-- Known to have occurred at midnight on September 1, 2012 -->
        <approvalDate>2012-09-01T00:00:00</approvalDate>

fac:complexDate represents an extension of simpleDate where the precision of the actual value cannot be expressed using xs:date, xs:dateTime or xs:time. This type defines a precision attribute which qualifies the value. Any date can be assigned a complexDate type by overriding its type, for example:
        <!-- Known to occur in September 2012 -->
        <approvalDate xsi:type="fac:complexDate" precision="M">2012-09-01</approvalDate>

Table X describes the precisions that can be conveyed using the fac:complexDate type:

---------------- END FRED API.DOC ----------------

Second, I agree that there is a difference between being optional in the schema and highly recommended in actual implementation. I think we can place this into the spec document as well as the schema as <xs:annotation> documentation using verbiage MUST/SHALL and MAY. For example:

--------- FRED API.DOC ---------
All facilities MUST carry an Active flag which MUST be set to true if an only if the facility is known to be accepting patients and is approved by the implementing jurisdiction. Additionally, facility resources MAY carry the optional Status field. When a facility resource carries a status it MUST be drawn from table X...
--------- END FRED API.DOC ---------

The text from the FRED API.DOC sections is just sample verbiage; I haven't actually started the documentation yet :wink:

Cheers
-Justin

···

-----Original Message-----
From: facility-registry@googlegroups.com [mailto:facility-registry@googlegroups.com] On Behalf Of Bob Jolliffe
Sent: Tuesday, October 09, 2012 6:36 PM
To: facility-registry@googlegroups.com
Subject: Re: Semantics in FRED spec

Thanks Andrew for this great feedback! I'll take some time to digest, but I think all of the points you raise are valid. I'm particularly thinking about how best to deal with "optional" elements and how they might be mandatory when dealing with different classes of conformance.

On 9 October 2012 23:16, Andrew Inglis <andrew.d.inglis@gmail.com> wrote:

Hi All,

I have been following this discussion with interest and have actually
follow up with some people involved in using Facility registries. I
have syntheses them into this response.

On the Date, having at least the Month/Year would be preferable of
just the year, The reason is when linking to existing datasets you
can confirm if the link is correct based on the only having data after
the facility was open. In number of countries (Ethiopia come to mind)
they have been opening facilities (then closing some) at a rapid rate,
thus just having the year is not enough. Therefore, I would suggest
that at least having month and year. I understand the issue that this
creates so if that means have the day/month/year that is preferable to just the year.

On the Approval Date, some facilities are not operating with approval
pending, in Kenya there some major facilities have been operating (for
years) still waiting for approval of their registration therefore i
might worth change it to operational date. Just a suggestion.

On the Status and Active, Active is a better binary field. I would
suggest that we look at adding Status into the Optional section, this
is very is a very useful field in particular when linking it to
existing data and managing the list.

Looking on the Optional sections, i understand the reason that we
don't want to be too prescriptive, however, instead referring to them
as "Optional" but as "Highly Recommended".

in managing health facilities lists have the "Agency", and an
additional field called "Type" are very useful in managing and linking
existing datasets.

On current optional area is "agency" I am assume is "owner" -
Government, Private, FBO, NGO in Kenya and Tanzania it was both very
useful in validating linking existing dataset together and in managing
the list of facilities in Kenya. The reason was that it this help
identify matches and when managing it helped Disitrict Health Offices
in Kenya in identify and ensuring that the exact number facilitie sin
the district were known and how many were government vs
non-government. Not knowing this distinction lead to confusion on the
exact number of facilities as people would include and exclude sites
based what they thought facility was, having this classification in the registry gave clarity.

Facility "Type" again is very useful when linking existing dataset and
in managing the list of facilities, it was useful in Kenya, Tanzania,
Zambia, Nigeria, Ghana and Rwanda. The reason being that when linking
existing data been able to differentiate ate by type was very useful in validating
linkages. In some cases their would two to three sites with the same name
but were different types. Also, the type was not always in the name,
secondly some sites changed type but did not change their name thus
the name lead to confusion thus in managing the list know the type
became very important.

On the Geo.xsd

I would also suggest adding two elements;

Setting the number decimal places to at least 4 decimal places. if you
have less than that then the accuracy of the location is limited and
it hard to differentiate if you have two sites next to one another or
are the same site just know by different names. This is a common
occurrence in some countries where it has name such as St Joseph
Hospital but is also know as FRED District Hospital. Thus having the
data at least to the 4 decimal point will help in managing the data
quality if the coordinates and identifying duplicates.

I would also suggest adding a field called "Accuracy" which describes
the accuracy of the coordinates either as - "GPS", "Detail Map"
"Gazetted" or "Unknown". In Rwanda it was very fortunate that the
government had geocoded a large number of the sites. in other
countries this is not the case where the geocodes come from a number
of difference sources with different level of accuracy. Therefore, i
would suggest the addition of this field if the plan is expand its
other countries. It would also help the in the management in to where cooridates to be updated.

I have included a link to a publication under the USAID|DELIVER
PROJECT that describes this in greater detail
http://www.deliver.jsi.com/dlvr_content/resources/allpubs/guidelines/G
uidLinkLogDat_GIS.pdf

I hope this is useful feedback.

Andrew Inglis
GIS Team Leader
John Snow, Inc.
USAID | DELIVER PROJECT
1616 Fort Myer Drive
11th Floor
Arlington, VA 22209
(703) 528-7474 ext. 5270
andrew_inglis@jsi.com
Learn about JSI at: www.jsi.com

On Tuesday, October 9, 2012, Bob Jolliffe wrote:

Hi Mead

Agree that times and dates are always a can of worms. With routine
reporting we have huge difficulties with weekly periods (everyone has
a different idea about the first day of the first week of the year),
financial year reporting and whether folk choose to look at the moon
(Islamic calendar) or the the sun to mark the passage of time.

This case is hopefully simpler ...

What we really need to get to, as Rowena is suggesting, is what users
will really use this <openingDate> for. If it is just for
informative display then it doesn't really matter (too much) what we put in it.
If it will be used in computations, eg. which facilities opened in
this period, then it is better to store a date in the backend
database, even if the user interface allows the entering of just
'2007'. Allowing for a union of different representations just puts
off the eventual resolution to a date till later.

But I don't have a really strong view on it. Except that I would use
the union type I referred to earlier rather than a regex. And unless
there is a compelling requirement for the extra complexity I'd favour
a simple date type for opening date.

Bob

On 5 October 2012 18:20, Mead Walker <dmead@comcast.net> wrote:
> Formats such as xs:date have always been a problem in healthcare
> (perhaps in other settings as well.
>
>
>
> The problem is that if you don't have a full date, it will default
> to something it makes up. So, January 14, turns into January 14,
> at midnight.
> October, 2011 turns into October 1 (or October 31) 2011. This
> creates a host of problems. It is also why HL7 has the date/time
> construction that it does
>
>
>
> Mead
>
>
>
> From: facility-registry@googlegroups.com
> [mailto:facility-registry@googlegroups.com] On Behalf Of Rowena Luk
> Sent: Friday, October 05, 2012 11:19 AM
>
>
> To: facility-registry@googlegroups.com
> Subject: Re: Semantics in FRED spec
>
>
>
> I'd be curious to hear more about the use case in Rwanda, and how
> strong a need/requirement that was. If it's not a hard requirement,
> I'd be in favour of sticking with the standard xs:date, for the
> sake of keeping the spec simple, clear, and consistent. Countries
> that map approval on the basis of yearly or monthly cycles could
> adopt some sort of internal convention to log those dates by the
> first or last day of those timespans.
>
> On Fri, Oct 5, 2012 at 10:34 AM, Bob Jolliffe >> > <bobjolliffe@gmail.com> >> > wrote:
>
> On 5 October 2012 14:42, Justin (Mohawk College) >> > >> > <justin.fyfe1@mohawkcollege.ca> wrote:
>> Hi Bob / Rowena,
>>
>> I think these changes to the schema are good, so long as the group
>> agrees they fulfill the use cases.
>>
>> If I understand properly, a status of "pending" would need to be
>> represented as an extension, however from a interoperability
>> standpoint it would be sufficient to know the facility is not yet
>> active:
>>
>> <active>false</active>
>> <x:status xmlns:x="urn:extension...">pending</x:status>
>
> Yes that is my understanding too ...
>
>
>>
>> Regarding date, it may be possible to fulfill the Rwanda usecase
>> for using
>> 2009 (any time during 2009), 2009-09 (any time during Sept. 2009)
>> and
>> 2009-09-09 using a restriction on xs:string which allows this, for
>> example:
>>
>> <xs:simpleType name="extDate">
>> <xs:restriction base="xs:string">
>> <xs:pattern value="^[0-9]{4}(-[0-9]{1,2})?(-[0-9]{1,2})?$"/>
>> </xs:restriction>
>> </xs:simpleType>
>>
>> And then referencing the type as <xs:element name="approvalDate"
>> type="fac:extDate"/>. This is similar to how the TS datatype is
>> specified in
>> HL7 schemas [ but don't say that too loudly :slight_smile: ]
>
> I love regexes but I am not sure they are the best for validating
> dates. The SDMX schemas (of which we'll also not speak too loudly)
> also address something similar by effectively allowing a union of
> standard types, something like this.
>
> <xs:simpleType name="extDate">
> <xs:union memberTypes="xs:dateTime xs:date
> xs:gYearMonth xs:gYear"/>
> </xs:simpleType>
>
> If this is indeed the semantics we want, I suggest we do it like this.
>
> Cheers
> Bob
>
>
>> Cheers
>> -Justin
>>
>>
>> On Friday, October 5, 2012 5:25:40 AM UTC-4, Bob Jolliffe wrote:
>>>
>>> Latest commit in response to Rowena's suggestion:
>>>
>>>
>>> --

--
Andrew Inglis

--

--

This E-mail contains privileged and confidential information intended
only for the individual or entity named in the message. If the reader
of this message is not the intended recipient, or the agent responsible
to deliver it to the intended recipient, you are hereby notified that
any review, dissemination, distribution or copying of this communication
is prohibited. If this communication was received in error, please
notify the sender by reply E-mail immediately, and delete and destroy
the original message.

Hi Justin

Sorry for the long delay in response. This week has proved busier
than I expected ...

Having had time to reflect on our previous discussion and also what
you have suggested here, I am drawn towards your solution. I think it
adequately meets the use cases we have seen described and the optional
attribute is a better reflection of the intent.

One small caveat .. I don't think xs:time is useful here. Isn't a
union of xs:date and xs:dateTime sufficient?

Bob

···

On 10 October 2012 16:15, Fyfe, Justin <justin.fyfe1@mohawkcollege.ca> wrote:

It appears that I have opened a can of worms so to speak :wink: I haven't had time to dive too deeply into the comments but here are some first reactions I have.

First, I think that date precision is one of the hanging points here. Mead alluded to this and it becomes important when implementing in Java/C# when dates are processed as DateTime or Calendar objects; it becomes impossible to determine the actual precision. HL7 handles this by representing a partial date (200909 for September 2009), however I think that this has some repercussions in terms of formatting and actually implementing (i.e. code generators will expose this as a String which isn't helpful IMO).

Also, I think Andrew touched on some business cases where some fields might be restricted to month (sorry if I misunderstood your commentary I haven't dived into deep thought about it), however I would like to stay away from restricting all dates to be precise to the month (but still allow this business case).

I see FRED as a messaging specification (+ reference implementation). I think we need to clearly define the difference between what is conveyed on the wire and what responsibility exists to store/reproduce the data. IMO consumers should merely be able to convey a precision based on their current dataset, user interface, or other factors and don't need to store the precision. For example, if an end-user program has UI with a calendar drop-down then it should convey it captured the date precise to the day, whereas another program with a year/month drop-down should convey the month precision. It doesn't matter how it is stored in their internal database. The FRED service implementers however do need to be aware of this precision and must be capable of regurgitating it.

My dream would be a common type definition that can be used for all dates/times that is consistent no matter what date data is being represented (opening date, approval date, or whatever dates we put into the messages in the future) and will allow any precision (HL7's TS is good at this however as I mentioned before there are repercussions of using that structure). What I'd like to have is some verbiage like this in the final API text (this is just a sample, I don't expect this will be the final solution we create):

---------------- FRED API.DOC ----------------
**Dates**

Dates and times are described in the FRED API using one of the following types: fac:simpleDate or fac:complexDate defined in Figure X.

Figure X - Schema for dates
  <xs:simpleType name="simpleDate">
    <xs:union memberTypes="xs:date xs:dateTime xs:time">
    </xs:union>
  </xs:simpleType>

  <xs:complexType name="complexDate">
    <xs:simpleContent>
      <xs:extension base="simpleDate">
        <xs:attribute name="offset">
          <xs:simpleType>
            <xs:restriction base="xs:string">
              <xs:enumeration value="D"/>
              <xs:enumeration value="M"/>
              <xs:enumeration value="Y"/>
            </xs:restriction>
          </xs:simpleType>
        </xs:attribute>
      </xs:extension>
    </xs:simpleContent>
  </xs:complexType>
End Figure X

These two types are used based on the following conditions:

fac:simpleDate (default) represents a union of xs:date, xs:dateTime and xs:time whereby the value reported in the instance represents the full precision of data:
        <!-- Known to have occurred on September 1 2012 -->
        <approvalDate>2012-09-01</approvalDate>
        <!-- Known to have occurred at midnight on September 1, 2012 -->
        <approvalDate>2012-09-01T00:00:00</approvalDate>

fac:complexDate represents an extension of simpleDate where the precision of the actual value cannot be expressed using xs:date, xs:dateTime or xs:time. This type defines a precision attribute which qualifies the value. Any date can be assigned a complexDate type by overriding its type, for example:
        <!-- Known to occur in September 2012 -->
        <approvalDate xsi:type="fac:complexDate" precision="M">2012-09-01</approvalDate>

Table X describes the precisions that can be conveyed using the fac:complexDate type:

---------------- END FRED API.DOC ----------------

Second, I agree that there is a difference between being optional in the schema and highly recommended in actual implementation. I think we can place this into the spec document as well as the schema as <xs:annotation> documentation using verbiage MUST/SHALL and MAY. For example:

--------- FRED API.DOC ---------
All facilities MUST carry an Active flag which MUST be set to true if an only if the facility is known to be accepting patients and is approved by the implementing jurisdiction. Additionally, facility resources MAY carry the optional Status field. When a facility resource carries a status it MUST be drawn from table X...
--------- END FRED API.DOC ---------

The text from the FRED API.DOC sections is just sample verbiage; I haven't actually started the documentation yet :wink:

Cheers
-Justin
-----Original Message-----
From: facility-registry@googlegroups.com [mailto:facility-registry@googlegroups.com] On Behalf Of Bob Jolliffe
Sent: Tuesday, October 09, 2012 6:36 PM
To: facility-registry@googlegroups.com
Subject: Re: Semantics in FRED spec

Thanks Andrew for this great feedback! I'll take some time to digest, but I think all of the points you raise are valid. I'm particularly thinking about how best to deal with "optional" elements and how they might be mandatory when dealing with different classes of conformance.

On 9 October 2012 23:16, Andrew Inglis <andrew.d.inglis@gmail.com> wrote:

Hi All,

I have been following this discussion with interest and have actually
follow up with some people involved in using Facility registries. I
have syntheses them into this response.

On the Date, having at least the Month/Year would be preferable of
just the year, The reason is when linking to existing datasets you
can confirm if the link is correct based on the only having data after
the facility was open. In number of countries (Ethiopia come to mind)
they have been opening facilities (then closing some) at a rapid rate,
thus just having the year is not enough. Therefore, I would suggest
that at least having month and year. I understand the issue that this
creates so if that means have the day/month/year that is preferable to just the year.

On the Approval Date, some facilities are not operating with approval
pending, in Kenya there some major facilities have been operating (for
years) still waiting for approval of their registration therefore i
might worth change it to operational date. Just a suggestion.

On the Status and Active, Active is a better binary field. I would
suggest that we look at adding Status into the Optional section, this
is very is a very useful field in particular when linking it to
existing data and managing the list.

Looking on the Optional sections, i understand the reason that we
don't want to be too prescriptive, however, instead referring to them
as "Optional" but as "Highly Recommended".

in managing health facilities lists have the "Agency", and an
additional field called "Type" are very useful in managing and linking
existing datasets.

On current optional area is "agency" I am assume is "owner" -
Government, Private, FBO, NGO in Kenya and Tanzania it was both very
useful in validating linking existing dataset together and in managing
the list of facilities in Kenya. The reason was that it this help
identify matches and when managing it helped Disitrict Health Offices
in Kenya in identify and ensuring that the exact number facilitie sin
the district were known and how many were government vs
non-government. Not knowing this distinction lead to confusion on the
exact number of facilities as people would include and exclude sites
based what they thought facility was, having this classification in the registry gave clarity.

Facility "Type" again is very useful when linking existing dataset and
in managing the list of facilities, it was useful in Kenya, Tanzania,
Zambia, Nigeria, Ghana and Rwanda. The reason being that when linking
existing data been able to differentiate ate by type was very useful in validating
linkages. In some cases their would two to three sites with the same name
but were different types. Also, the type was not always in the name,
secondly some sites changed type but did not change their name thus
the name lead to confusion thus in managing the list know the type
became very important.

On the Geo.xsd

I would also suggest adding two elements;

Setting the number decimal places to at least 4 decimal places. if you
have less than that then the accuracy of the location is limited and
it hard to differentiate if you have two sites next to one another or
are the same site just know by different names. This is a common
occurrence in some countries where it has name such as St Joseph
Hospital but is also know as FRED District Hospital. Thus having the
data at least to the 4 decimal point will help in managing the data
quality if the coordinates and identifying duplicates.

I would also suggest adding a field called "Accuracy" which describes
the accuracy of the coordinates either as - "GPS", "Detail Map"
"Gazetted" or "Unknown". In Rwanda it was very fortunate that the
government had geocoded a large number of the sites. in other
countries this is not the case where the geocodes come from a number
of difference sources with different level of accuracy. Therefore, i
would suggest the addition of this field if the plan is expand its
other countries. It would also help the in the management in to where cooridates to be updated.

I have included a link to a publication under the USAID|DELIVER
PROJECT that describes this in greater detail
http://www.deliver.jsi.com/dlvr_content/resources/allpubs/guidelines/G
uidLinkLogDat_GIS.pdf

I hope this is useful feedback.

Andrew Inglis
GIS Team Leader
John Snow, Inc.
USAID | DELIVER PROJECT
1616 Fort Myer Drive
11th Floor
Arlington, VA 22209
(703) 528-7474 ext. 5270
andrew_inglis@jsi.com
Learn about JSI at: www.jsi.com

On Tuesday, October 9, 2012, Bob Jolliffe wrote:

Hi Mead

Agree that times and dates are always a can of worms. With routine
reporting we have huge difficulties with weekly periods (everyone has
a different idea about the first day of the first week of the year),
financial year reporting and whether folk choose to look at the moon
(Islamic calendar) or the the sun to mark the passage of time.

This case is hopefully simpler ...

What we really need to get to, as Rowena is suggesting, is what users
will really use this <openingDate> for. If it is just for
informative display then it doesn't really matter (too much) what we put in it.
If it will be used in computations, eg. which facilities opened in
this period, then it is better to store a date in the backend
database, even if the user interface allows the entering of just
'2007'. Allowing for a union of different representations just puts
off the eventual resolution to a date till later.

But I don't have a really strong view on it. Except that I would use
the union type I referred to earlier rather than a regex. And unless
there is a compelling requirement for the extra complexity I'd favour
a simple date type for opening date.

Bob

On 5 October 2012 18:20, Mead Walker <dmead@comcast.net> wrote:
> Formats such as xs:date have always been a problem in healthcare
> (perhaps in other settings as well.
>
>
>
> The problem is that if you don't have a full date, it will default
> to something it makes up. So, January 14, turns into January 14,
> at midnight.
> October, 2011 turns into October 1 (or October 31) 2011. This
> creates a host of problems. It is also why HL7 has the date/time
> construction that it does
>
>
>
> Mead
>
>
>
> From: facility-registry@googlegroups.com
> [mailto:facility-registry@googlegroups.com] On Behalf Of Rowena Luk
> Sent: Friday, October 05, 2012 11:19 AM
>
>
> To: facility-registry@googlegroups.com
> Subject: Re: Semantics in FRED spec
>
>
>
> I'd be curious to hear more about the use case in Rwanda, and how
> strong a need/requirement that was. If it's not a hard requirement,
> I'd be in favour of sticking with the standard xs:date, for the
> sake of keeping the spec simple, clear, and consistent. Countries
> that map approval on the basis of yearly or monthly cycles could
> adopt some sort of internal convention to log those dates by the
> first or last day of those timespans.
>
> On Fri, Oct 5, 2012 at 10:34 AM, Bob Jolliffe >>> > <bobjolliffe@gmail.com> >>> > wrote:
>
> On 5 October 2012 14:42, Justin (Mohawk College) >>> > >>> > <justin.fyfe1@mohawkcollege.ca> wrote:
>> Hi Bob / Rowena,
>>
>> I think these changes to the schema are good, so long as the group
>> agrees they fulfill the use cases.
>>
>> If I understand properly, a status of "pending" would need to be
>> represented as an extension, however from a interoperability
>> standpoint it would be sufficient to know the facility is not yet
>> active:
>>
>> <active>false</active>
>> <x:status xmlns:x="urn:extension...">pending</x:status>
>
> Yes that is my understanding too ...
>
>
>>
>> Regarding date, it may be possible to fulfill the Rwanda usecase
>> for using
>> 2009 (any time during 2009), 2009-09 (any time during Sept. 2009)
>> and
>> 2009-09-09 using a restriction on xs:string which allows this, for
>> example:
>>
>> <xs:simpleType name="extDate">
>> <xs:restriction base="xs:string">
>> <xs:pattern value="^[0-9]{4}(-[0-9]{1,2})?(-[0-9]{1,2})?$"/>
>> </xs:restriction>
>> </xs:simpleType>
>>
>> And then referencing the type as <xs:element name="approvalDate"
>> type="fac:extDate"/>. This is similar to how the TS datatype is
>> specified in
>> HL7 schemas [ but don't say that too loudly :slight_smile: ]
>
> I love regexes but I am not sure they are the best for validating
> dates. The SDMX schemas (of which we'll also not speak too loudly)
> also address something similar by effectively allowing a union of
> standard types, something like this.
>
> <xs:simpleType name="extDate">
> <xs:union memberTypes="xs:dateTime xs:date
> xs:gYearMonth xs:gYear"/>
> </xs:simpleType>
>
> If this is indeed the semantics we want, I suggest we do it like this.
>
> Cheers
> Bob
>
>
>> Cheers
>> -Justin
>>
>>
>> On Friday, October 5, 2012 5:25:40 AM UTC-4, Bob Jolliffe wrote:
>>>
>>> Latest commit in response to Rowena's suggestion:
>>>
>>>
>>> --

--
Andrew Inglis

--

--

This E-mail contains privileged and confidential information intended
only for the individual or entity named in the message. If the reader
of this message is not the intended recipient, or the agent responsible
to deliver it to the intended recipient, you are hereby notified that
any review, dissemination, distribution or copying of this communication
is prohibited. If this communication was received in error, please
notify the sender by reply E-mail immediately, and delete and destroy
the original message.

--

Hi Bob,

Looking back at that type, I think that xs:time was an experimentation that I was doing and fogot to remove it :). I agree that a union of date and dateTime would cover the use cases.

Cheers

-Justin

···

On Wednesday, October 17, 2012 3:56:30 PM UTC-4, Bob Jolliffe wrote:

Hi Justin

Sorry for the long delay in response. This week has proved busier

than I expected …

Having had time to reflect on our previous discussion and also what

you have suggested here, I am drawn towards your solution. I think it

adequately meets the use cases we have seen described and the optional

attribute is a better reflection of the intent.

One small caveat … I don’t think xs:time is useful here. Isn’t a

union of xs:date and xs:dateTime sufficient?

Bob

On 10 October 2012 16:15, Fyfe, Justin justin...@mohawkcollege.ca wrote:

It appears that I have opened a can of worms so to speak :wink: I haven’t had time to dive too deeply into the comments but here are some first reactions I have.

First, I think that date precision is one of the hanging points here. Mead alluded to this and it becomes important when implementing in Java/C# when dates are processed as DateTime or Calendar objects; it becomes impossible to determine the actual precision. HL7 handles this by representing a partial date (200909 for September 2009), however I think that this has some repercussions in terms of formatting and actually implementing (i.e. code generators will expose this as a String which isn’t helpful IMO).

Also, I think Andrew touched on some business cases where some fields might be restricted to month (sorry if I misunderstood your commentary I haven’t dived into deep thought about it), however I would like to stay away from restricting all dates to be precise to the month (but still allow this business case).

I see FRED as a messaging specification (+ reference implementation). I think we need to clearly define the difference between what is conveyed on the wire and what responsibility exists to store/reproduce the data. IMO consumers should merely be able to convey a precision based on their current dataset, user interface, or other factors and don’t need to store the precision. For example, if an end-user program has UI with a calendar drop-down then it should convey it captured the date precise to the day, whereas another program with a year/month drop-down should convey the month precision. It doesn’t matter how it is stored in their internal database. The FRED service implementers however do need to be aware of this precision and must be capable of regurgitating it.

My dream would be a common type definition that can be used for all dates/times that is consistent no matter what date data is being represented (opening date, approval date, or whatever dates we put into the messages in the future) and will allow any precision (HL7’s TS is good at this however as I mentioned before there are repercussions of using that structure). What I’d like to have is some verbiage like this in the final API text (this is just a sample, I don’t expect this will be the final solution we create):

---------------- FRED API.DOC ----------------

Dates

Dates and times are described in the FRED API using one of the following types: fac:simpleDate or fac:complexDate defined in Figure X.

Figure X - Schema for dates

<xs:simpleType name=“simpleDate”>

<xs:union memberTypes="xs:date xs:dateTime xs:time">
</xs:union>

</xs:simpleType>

<xs:complexType name=“complexDate”>

<xs:simpleContent>
  <xs:extension base="simpleDate">
    <xs:attribute name="offset">
      <xs:simpleType>
        <xs:restriction base="xs:string">
          <xs:enumeration value="D"/>
          <xs:enumeration value="M"/>
          <xs:enumeration value="Y"/>
        </xs:restriction>
      </xs:simpleType>
    </xs:attribute>
  </xs:extension>
</xs:simpleContent>

</xs:complexType>

End Figure X

These two types are used based on the following conditions:

fac:simpleDate (default) represents a union of xs:date, xs:dateTime and xs:time whereby the value reported in the instance represents the full precision of data:

    <!-- Known to have occurred on September 1 2012 -->
    <approvalDate>2012-09-01</approvalDate>
    <!-- Known to have occurred at midnight on September 1, 2012 -->
    <approvalDate>2012-09-01T00:00:00</approvalDate>

fac:complexDate represents an extension of simpleDate where the precision of the actual value cannot be expressed using xs:date, xs:dateTime or xs:time. This type defines a precision attribute which qualifies the value. Any date can be assigned a complexDate type by overriding its type, for example:

    <!-- Known to occur in September 2012 -->
    <approvalDate xsi:type="fac:complexDate" precision="M">2012-09-01</approvalDate>

Table X describes the precisions that can be conveyed using the fac:complexDate type:

---------------- END FRED API.DOC ----------------

Second, I agree that there is a difference between being optional in the schema and highly recommended in actual implementation. I think we can place this into the spec document as well as the schema as xs:annotation documentation using verbiage MUST/SHALL and MAY. For example:

--------- FRED API.DOC ---------

All facilities MUST carry an Active flag which MUST be set to true if an only if the facility is known to be accepting patients and is approved by the implementing jurisdiction. Additionally, facility resources MAY carry the optional Status field. When a facility resource carries a status it MUST be drawn from table X…

--------- END FRED API.DOC ---------

The text from the FRED API.DOC sections is just sample verbiage; I haven’t actually started the documentation yet :wink:

Cheers

-Justin

-----Original Message-----

From: facility...@googlegroups.com [mailto:facility...@googlegroups.com] On Behalf Of Bob Jolliffe

Sent: Tuesday, October 09, 2012 6:36 PM

To: facility...@googlegroups.com

Subject: Re: Semantics in FRED spec

Thanks Andrew for this great feedback! I’ll take some time to digest, but I think all of the points you raise are valid. I’m particularly thinking about how best to deal with “optional” elements and how they might be mandatory when dealing with different classes of conformance.

On 9 October 2012 23:16, Andrew Inglis andrew....@gmail.com wrote:

Hi All,

I have been following this discussion with interest and have actually

follow up with some people involved in using Facility registries. I

have syntheses them into this response.

On the Date, having at least the Month/Year would be preferable of

just the year, The reason is when linking to existing datasets you

can confirm if the link is correct based on the only having data after

the facility was open. In number of countries (Ethiopia come to mind)

they have been opening facilities (then closing some) at a rapid rate,

thus just having the year is not enough. Therefore, I would suggest

that at least having month and year. I understand the issue that this

creates so if that means have the day/month/year that is preferable to just the year.

On the Approval Date, some facilities are not operating with approval

pending, in Kenya there some major facilities have been operating (for

years) still waiting for approval of their registration therefore i

might worth change it to operational date. Just a suggestion.

On the Status and Active, Active is a better binary field. I would

suggest that we look at adding Status into the Optional section, this

is very is a very useful field in particular when linking it to

existing data and managing the list.

Looking on the Optional sections, i understand the reason that we

don’t want to be too prescriptive, however, instead referring to them

as “Optional” but as “Highly Recommended”.

in managing health facilities lists have the “Agency”, and an

additional field called “Type” are very useful in managing and linking

existing datasets.

On current optional area is “agency” I am assume is “owner” -

Government, Private, FBO, NGO in Kenya and Tanzania it was both very

useful in validating linking existing dataset together and in managing

the list of facilities in Kenya. The reason was that it this help

identify matches and when managing it helped Disitrict Health Offices

in Kenya in identify and ensuring that the exact number facilitie sin

the district were known and how many were government vs

non-government. Not knowing this distinction lead to confusion on the

exact number of facilities as people would include and exclude sites

based what they thought facility was, having this classification in the registry gave clarity.

Facility “Type” again is very useful when linking existing dataset and

in managing the list of facilities, it was useful in Kenya, Tanzania,

Zambia, Nigeria, Ghana and Rwanda. The reason being that when linking

existing data been able to differentiate ate by type was very useful in validating

linkages. In some cases their would two to three sites with the same name

but were different types. Also, the type was not always in the name,

secondly some sites changed type but did not change their name thus

the name lead to confusion thus in managing the list know the type

became very important.

On the Geo.xsd

I would also suggest adding two elements;

Setting the number decimal places to at least 4 decimal places. if you

have less than that then the accuracy of the location is limited and

it hard to differentiate if you have two sites next to one another or

are the same site just know by different names. This is a common

occurrence in some countries where it has name such as St Joseph

Hospital but is also know as FRED District Hospital. Thus having the

data at least to the 4 decimal point will help in managing the data

quality if the coordinates and identifying duplicates.

I would also suggest adding a field called “Accuracy” which describes

the accuracy of the coordinates either as - “GPS”, “Detail Map”

“Gazetted” or “Unknown”. In Rwanda it was very fortunate that the

government had geocoded a large number of the sites. in other

countries this is not the case where the geocodes come from a number

of difference sources with different level of accuracy. Therefore, i

would suggest the addition of this field if the plan is expand its

other countries. It would also help the in the management in to where cooridates to be updated.

I have included a link to a publication under the USAID|DELIVER

PROJECT that describes this in greater detail

http://www.deliver.jsi.com/dlvr_content/resources/allpubs/guidelines/G

uidLinkLogDat_GIS.pdf

I hope this is useful feedback.

Andrew Inglis

GIS Team Leader

John Snow, Inc.

USAID | DELIVER PROJECT

1616 Fort Myer Drive

11th Floor

Arlington, VA 22209

(703) 528-7474 ext. 5270

andrew...@jsi.com

Learn about JSI at: www.jsi.com

On Tuesday, October 9, 2012, Bob Jolliffe wrote:

Hi Mead

Agree that times and dates are always a can of worms. With routine

reporting we have huge difficulties with weekly periods (everyone has

a different idea about the first day of the first week of the year),

financial year reporting and whether folk choose to look at the moon

(Islamic calendar) or the the sun to mark the passage of time.

This case is hopefully simpler …

What we really need to get to, as Rowena is suggesting, is what users

will really use this for. If it is just for

informative display then it doesn’t really matter (too much) what we put in it.

If it will be used in computations, eg. which facilities opened in

this period, then it is better to store a date in the backend

database, even if the user interface allows the entering of just

‘2007’. Allowing for a union of different representations just puts

off the eventual resolution to a date till later.

But I don’t have a really strong view on it. Except that I would use

the union type I referred to earlier rather than a regex. And unless

there is a compelling requirement for the extra complexity I’d favour

a simple date type for opening date.

Bob

On 5 October 2012 18:20, Mead Walker dm...@comcast.net wrote:

Formats such as xs:date have always been a problem in healthcare

(perhaps in other settings as well.

The problem is that if you don’t have a full date, it will default

to something it makes up. So, January 14, turns into January 14,

at midnight.

October, 2011 turns into October 1 (or October 31) 2011. This

creates a host of problems. It is also why HL7 has the date/time

construction that it does

Mead

From: facility...@googlegroups.com

[mailto:facility...@googlegroups.com] On Behalf Of Rowena Luk

Sent: Friday, October 05, 2012 11:19 AM

To: facility...@googlegroups.com

Subject: Re: Semantics in FRED spec

I’d be curious to hear more about the use case in Rwanda, and how

strong a need/requirement that was. If it’s not a hard requirement,

I’d be in favour of sticking with the standard xs:date, for the

sake of keeping the spec simple, clear, and consistent. Countries

that map approval on the basis of yearly or monthly cycles could

adopt some sort of internal convention to log those dates by the

first or last day of those timespans.

On Fri, Oct 5, 2012 at 10:34 AM, Bob Jolliffe > > >>> > bobjo...@gmail.com > > >>> > wrote:

On 5 October 2012 14:42, Justin (Mohawk College) > > >>> > > > >>> > justin...@mohawkcollege.ca wrote:

Hi Bob / Rowena,

I think these changes to the schema are good, so long as the group

agrees they fulfill the use cases.

If I understand properly, a status of “pending” would need to be

represented as an extension, however from a interoperability

standpoint it would be sufficient to know the facility is not yet

active:

false

<x:status xmlns:x=“urn:extension…”>pending</x:status>

Yes that is my understanding too …

Regarding date, it may be possible to fulfill the Rwanda usecase

for using

2009 (any time during 2009), 2009-09 (any time during Sept. 2009)

and

2009-09-09 using a restriction on xs:string which allows this, for

example:

<xs:simpleType name=“extDate”>

<xs:restriction base=“xs:string”>

<xs:pattern value="^[0-9]{4}(-[0-9]{1,2})?(-[0-9]{1,2})?$"/>

</xs:restriction>

</xs:simpleType>

And then referencing the type as <xs:element name=“approvalDate”

type=“fac:extDate”/>. This is similar to how the TS datatype is

specified in

HL7 schemas [ but don’t say that too loudly :slight_smile: ]

I love regexes but I am not sure they are the best for validating

dates. The SDMX schemas (of which we’ll also not speak too loudly)

also address something similar by effectively allowing a union of

standard types, something like this.

  <xs:simpleType name="extDate">
            <xs:union memberTypes="xs:dateTime xs:date

xs:gYearMonth xs:gYear"/>

    </xs:simpleType>

If this is indeed the semantics we want, I suggest we do it like this.

Cheers

Bob

Cheers

-Justin

On Friday, October 5, 2012 5:25:40 AM UTC-4, Bob Jolliffe wrote:

Latest commit in response to Rowena’s suggestion:

Andrew Inglis

This E-mail contains privileged and confidential information intended

only for the individual or entity named in the message. If the reader

of this message is not the intended recipient, or the agent responsible

to deliver it to the intended recipient, you are hereby notified that

any review, dissemination, distribution or copying of this communication

is prohibited. If this communication was received in error, please

notify the sender by reply E-mail immediately, and delete and destroy

the original message.