Questions about resources in Allergy UI module

Sorry for the confusion, I have been completely incorrect in my usage of NKA in my previous two posts.

What I mean to ask was: how do you set a patient’s allergy status to unknown?

The pattern we have followed for personattribute and patientidentifier are as follows:

  • GET person/uuid/attribute => { results: […] } // results are paged if there are many
  • POST person/uuid/attribute => creates one new personattribute
  • DELETE person/uuid/attribute => invalid operation
  • GET person/uuid/attribute/attruuid => { representation of one personattribute }
  • POST person/uuid/attribute/attruuid => updates a specific personattribute
  • DELETE person/uuid/attribute/attruuid => voids a specific personattribute

To follow this same pattern (which should be our default approach) allergy would look like:

  • GET patient/uuid/allergy => { results: […] } // results are paged if there are many
  • see below for discussion
  • POST patient/uuid/allergy => creates one new allergy
  • DELETE patient/uuid/allergy => sets allergyStatus to unknown and voids all allergies
  • this is new (e.g. there’s no equivalent mechanism to remove all personattributes)
  • GET patient/uuid/allergy/allergyuuid => { representation of one allergy }
  • POST patient/uuid/allergy/allergyuuid => updates a specific allergy
  • DELETE patient/uuid/allergy/allergyuuid => voids a specific allergy

About GET patient/uuid/allergy@burke says that should return 404 for the unknown state. I think this will be unintuitive for a client, and I propose that we do:

(if no known allergies)

{
    status: "No known allergies"
    results: []
}

(if some)

{
    status: "See list"
    results: [
        { /* ... */ }
    ],
    links: [ ... ]  // if >1 page of results, which should never happen in real life unless the client requests a small page size
}

(if unknown)

{
    status: "Unknown"
}

(these text strings are from the Java API (see here)