Giter VIP home page Giter VIP logo

Comments (8)

patrickvinograd avatar patrickvinograd commented on June 19, 2024 2

Yes, absolutely on both returning the hierarchy and only including the present services. My suggestion is something like this:

...
"Services": {
  "PrimaryCare": [],
  "Rehabilitation": [],
  "MentalHealthCare": ["OutpatientMHCare", "OutpatientSpecMHCare"]
}
...

I.e. SL1 services are indicated by presence as keys in the overall "Services" dict. SL2 services are indicated by presence in the list that you get back from their parent SL1 key. SL1 services that don't have any sub-services have an empty list, but are still available as a top-level service.

It's a little awkward mixing dicts and lists, but it avoids the redundant "true" values for the SL2 services. And while I like the idea of the backend owning/returning the display names, I don't want to repeat that information on each and every record. I'd rather have a separate metadata endpoint where we can serve the hierarchy info statically; frontend apps can retrieve it once and cache it.

from vets-api.

ayaleloehr avatar ayaleloehr commented on June 19, 2024 1

You're probably also saying, well which services are nested under what?! Here is a list:

Audiology
ComplementaryAlternativeMed
DentalServices
DiagnosticServices
    ImagingAndRadiology
    LabServices
EmergencyDept
EyeCare
MentalHealthCare
    OutpatientMHCare
    OutpatientSpecMHCare
    VocationalAssistance
OutpatientMedicalSpecialty
    AllergyAndImmunology
    CardiologyCareServices
    DermatologyCareServices
    Diabetes
    Dialysis
    Endocrinology
    Gastroenterology
    Hematology
    InfectiousDisease
    InternalMedicine
    Nephrology
    Neurology
    Oncology
    PulmonaryRespiratoryDisease
    Rheumatology
    SleepMedicine
OutpatientSurgicalSpecialty
    CardiacSurgery
    ColoRectalSurgery
    ENT
    GeneralSurgery
    Gynecology
    Neurosurgery
    Orthopedics
    PainManagement
    PlasticSurgery
    Podiatry
    ThoracicSurgery
    Urology
    VascularSurgery
PrimaryCare
Rehabilitation
UrgentCare
WellnessAndPreventativeCare

We would have to build this logic manually into the API I'm thinking...

from vets-api.

bshyong avatar bshyong commented on June 19, 2024

re: 1) In the front-end, it would be nice to have the keys nested and the nesting logic built into the API. It's probably better to have the service hierarchy in the backend instead of frontend.

re: 2), only including services that are available saves us from having to iterate over the entire response. As an added bonus, maybe we could use the value field to store a formatted display name so that the names are more descriptive, ie

"MentalHealthCare": {
  "OutpatientMHCare": "Outpatient Mental Health Care",
  "OutpatientSpecMHCare": "Outpatient Specialized Mental Health Care",
}

from vets-api.

patrickvinograd avatar patrickvinograd commented on June 19, 2024

Representing the L1 services as keys in a dict makes things awkward because the keys get treated as keys from the JSON API perspective and get munged by Olive Branch, but the values do not. So now proposing to make the services a big nested list so it just gets treated as data:

[
  ["Audiology",[]],
  ["DentalServices",[]],
  ["DiagnosticServices",["ImagingAndRadiology"]],
  ["EyeCare",[]],
  ["MentalHealthCare",["OutpatientMHCare","OutpatientSpecMHCare","VocationalAssistance"]],
  ["OutpatientSurgicalSpecialty",["Podiatry"]],
  ["PrimaryCare",[]],
  ["Rehabilitation",[]],
  ["WellnessAndPreventativeCare",[]]
]

Overall list of services is a list of tuples, first element being an SL1 service, second element being a list of SL2 services (or an empty list).

from vets-api.

carlmjohnson avatar carlmjohnson commented on June 19, 2024

What about something like this:

[
    {
        "L1": "Audiology",
        "L2": []
    },
    {
        "L1": "DentalServices",
        "L2": []
    },
    {
        "L1": "DiagnosticServices",
        "L2": [
            "ImagingAndRadiology"
        ]
    },
    {
        "L1": "EyeCare",
        "L2": []
    },
    {
        "L1": "MentalHealthCare",
        "L2": [
            "OutpatientMHCare",
            "OutpatientSpecMHCare",
            "VocationalAssistance"
        ]
    },
    {
        "L1": "OutpatientSurgicalSpecialty",
        "L2": [
            "Podiatry"
        ]
    },
    {
        "L1": "PrimaryCare",
        "L2": []
    },
    {
        "L1": "Rehabilitation",
        "L2": []
    },
    {
        "L1": "WellnessAndPreventativeCare",
        "L2": []
    }
]

from vets-api.

patrickvinograd avatar patrickvinograd commented on June 19, 2024

@carlmjohnson Yeah, I like that better, having the L1/L2 keys gives some indication of the semantics.

from vets-api.

bshyong avatar bshyong commented on June 19, 2024

^ that structure LGTM

from vets-api.

patrickvinograd avatar patrickvinograd commented on June 19, 2024

Works well with olive branch so I'm going to say that's decided. See #134 for full record format description.

from vets-api.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.