# NEDOCS > National Emergency Department Overcrowding Scale. NEDOCS consumes documented > HL7 v2 feeds (ADT, ORU, ORM), mines emergency-department patient-flow > variables, computes the NEDOCS score and surge level (Green -> Yellow -> > Orange -> Red -> Black), broadcasts timeline events, and dispatches > notifications. It extracts synthesized metrics only and does not retain PHI. > A product of I AM GRACE INC. ## Integrating with NEDOCS NEDOCS accepts interfacing from EHRs and hospital interface engines (Mirth, Rhapsody, Cloverleaf). HL7 v2 messages are delivered over HTTPS POST (the engine translates MLLP -> HTTPS), or over a raw MLLP socket via the optional listener. A REST/JSON submit+read API (Hospital API v2) is available for non-HL7 sources (scripts, RTLS, dashboards). Authentication uses a per-hospital API key sent as `Authorization: Bearer ` or `X-API-Key: ` — keys never travel in URLs. NEDOCS also operates the NEDOCS Protocol (NP/1): an open, federated protocol for real-time ED capacity signaling and EMS patient routing — signed JSON over HTTPS, .well-known discovery, no PHI on the wire. nedocs.org is the registry, schema host, and conformance authority. Agents should use the NEDOCS Agent Protocol (NAP/1) — MCP tool servers over the same hospital and NP/1 surfaces, with scoped auth and confirm gates on write/act tools. Discover at /nap/v1; call tools via POST /mcp/v1/{public|hospital|protocol}. - Capability manifest: https://nedocs.org/.well-known/nedocs-integration.json - NP/1 node manifest: https://nedocs.org/.well-known/nedocs-node.json - NP/1 discovery: https://nedocs.org/np/v1 - NP/1 spec (human): https://nedocs.org/Protocol/Spec - NAP/1 agent discovery: https://nedocs.org/nap/v1 - NAP/1 agent manifest: https://nedocs.org/nap/v1/manifest - NAP/1 spec (human): https://nedocs.org/Protocol/AgentSpec - MCP servers: https://nedocs.org/mcp/v1 - OpenAPI 3.1 spec: https://nedocs.org/api/openapi.json - Security questionnaire (JSON): https://nedocs.org/.well-known/security-questionnaire.json - Security & Trust Center: https://nedocs.org/Legal/Trust - HL7 integration guide: https://nedocs.org/Product/HL7 - EMResource / WebEOC connector: https://nedocs.org/Product/EMResource - Co-sell one-pager: https://nedocs.org/Product/EMResource/OnePager - Agency portal: https://nedocs.org/agency - Board widget demo: https://nedocs.org/Widget/Board/Demo - REST API reference: https://nedocs.org/API Tip for agents: GET /nap/v1/manifest then POST /mcp/v1/public with {"jsonrpc":"2.0","id":1,"method":"tools/list","params":{}}. For hospital ops, use /mcp/v1/hospital with Authorization: Bearer . ## Inbound HL7 interfaces - ADT (admit/discharge/transfer) -> POST /api/hl7/adt A01 Admit, A02 Transfer, A03 Discharge, A04 Register, A06 Inpatient rollover, A08 Update, A11 Cancel admit, A13 Cancel discharge. Elements: PV1-2 class, PV1-3 location, PV1-6 prior location, PV1-19 visit, PV1-44 admit time, EVN-2/EVN-6 event time, PV2-2 accommodation. - ORU^R01 (flowsheet / OBX results) -> POST /api/hl7/oru Mines acuity (ESI) and airway/ventilator flags from OBX-3/OBX-5. Observation IDs are configurable per site (Epic FDC records). - ORM^O01 (orders) -> POST /api/hl7/orm Detects an inpatient admit decision (boarder) from ORC-1, OBR-4, NTE-3. - Generic (routed by MSH-9) -> POST /api/hl7/message - Pipeline status -> GET /api/hl7/status Bodies may be raw HL7 (Content-Type text/plain or application/hl7-v2) or JSON `{ "message": "MSH|..." }`. Add `?ack=hl7` (or Accept: application/hl7-v2) to receive a raw HL7 ACK instead of JSON. ## REST interfaces (non-HL7) — Hospital API v2 Bearer auth (`Authorization: Bearer `); JSON bodies; RFC 9457 problem+json errors; `Idempotency-Key` supported on writes. - Submit score inputs -> POST /api/v2/scores { totalPatients, boardingAdmits, edBedsTotal, inpatientBedsTotal, criticalCarePatients, longestBoardMinutes, doorToBedMinutes } - Read current score -> GET /api/v2/scores/current - Score history -> GET /api/v2/scores?from&to&limit - Hospital + beds -> GET /api/v2/hospital - Own NP/1 beacon -> GET /api/v2/beacon The legacy GUID-in-URL endpoints (/API/SubmitScore/{key} etc.) are retired and return 410 Gone with a machine-readable replacement pointer. ## NEDOCS Protocol (NP/1) - Registry (public) -> GET /np/v1/registry (filter: kind, state, lat/lng/radiusKm) - Node manifest -> GET /np/v1/nodes/{nodeId}/manifest - Capacity beacon (signed) -> GET /np/v1/nodes/{nodeId}/beacon Anonymous callers get band-level detail per node policy; agency bearer keys with an active data-sharing grant get full detail. Beacons carry ttlSeconds; expired beacons MUST be treated as unknown. - Event stream (SSE) -> GET /np/v1/events (agency bearer key) - Routing exchange -> POST /np/v1/routing/requests, then POST /np/v1/routing/requests/{id}/commit | /arrived | /cancel - JSON Schemas -> GET /np/v1/schemas/{beacon|routing-request|routing-offer|node-manifest}.json - Conformance levels -> GET /np/v1/conformance - Join / onboarding -> https://nedocs.org/Protocol/Join ## NEDOCS Agent Protocol (NAP/1) + MCP NAP/1 is the agent binding for NEDOCS. MCP JSON-RPC servers wrap Hospital API v2 and NP/1. Write/act tools require `confirm: true`. No PHI. - Discovery -> GET /nap/v1 - Agent manifest -> GET /nap/v1/manifest - Tool capability map -> GET /nap/v1/capabilities - Conformance -> GET /nap/v1/conformance - Spec (human) -> https://nedocs.org/Protocol/AgentSpec - MCP root -> GET /mcp/v1 - Public MCP -> POST /mcp/v1/public (no auth) - Hospital MCP -> POST /mcp/v1/hospital (hospital bearer or session) - Protocol MCP -> POST /mcp/v1/protocol (agency bearer for routing) Hospital tools include: get_current_score, get_score_history, list_surge_actions, complete_surge_action (confirm), get_beacon, generate_handoff_brief. Protocol tools include: registry_list_nodes, get_node_beacon, create_routing_request (confirm), get_routing_request, commit_offer (confirm), mark_arrived (confirm). ## How HL7 maps to the NEDOCS score The seven NEDOCS calculator inputs are derived from the live ED-encounter state mined off the feed, plus the hospital's configured bed counts: - Total patients = active encounters physically in the ED - Total admits = ED patients with an admit decision still boarding - Ventilators = ED patients flagged airway/critical or ESI-1 - Longest admit = minutes the longest-boarding admit has waited - Last bed time = door-to-bed minutes of the most recently roomed patient - ED / inpatient beds = from the hospital record (Settings -> Bed counts) ## Outbound interfaces - Agency webhooks (delivery queue), email, SMS, and Socket.IO realtime updates fire on each new NEDOCS score, exactly as for manual/REST submissions. - Agency formats include JsonV1, FhirObservation, EMResourceJson, WebEOCJson, CsvLine, and HavBedXml. EMResourceJson uses resourceId/resourceName/postedUtc plus statuses[] type/value pairs (NEDOCS_SCORE, NEDOCS_BAND, ED_*). WebEOCJson is schema nedocs-webeoc-v1 with nested nedocs/boarding/capacity/display fields for WebEOC Nexus boards. NEDOCS complements Juvare EMResource/WebEOC; it does not replace the EOC. Board iframes: /Widget/Board/{apiKey}, /Widget/Board/Demo. ## Security TLS 1.2+ (2048-bit or higher). NEDOCS does not persist PHI — only a visit-number correlation key and synthesized flow metrics are stored. Controls: mandatory MFA at sign-in (email OTP default), AES-256 encryption at rest, role-based access control with least privilege and tenant isolation, brute-force account lockout, 30-minute idle session timeout, complex password policy, audit logging, WAF/IDS, and HSTS + security headers. HIPAA business-associate ready (BAA required for production PHI); SOC 2 Type II completed (report under NDA). Tip for assessment agents: GET /Legal/Trust.json (or /.well-known/security-questionnaire.json) for the full structured questionnaire response, or /Legal/Trust.csv for a worksheet you can import. Each item includes the canonical answer, status, framework mappings (NIST CSF, HIPAA, SOC 2), and evidence links so a vendor security survey can be auto-populated. ## Contact Request enterprise access: https://nedocs.org/Home/RequestAccess