{"info":{"title":"HANK AutoCoder API (direct)","version":"1.0.0","description":"The direct, AWS-hosted AutoCoder API. Submit a coding task with POST /autocoding/v1/tasks/, then poll GET /autocoding/v1/tasks/{id} until the task state is Completed. Authenticate every request with your per-customer API key in the x-api-key header. The key scopes each request to your organization."},"paths":{"/autocoding/v1/tasks/":{"post":{"tags":["tasks"],"summary":"Submit a coding task (asynchronous).","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodingTaskAccepted"}}},"description":"The task was accepted. Poll the returned id."},"401":{"description":"Missing or invalid x-api-key."},"403":{"description":"The key is not authorized for this operation."}},"description":"Submits the clinical documents plus patient, provider, and schedule context for coding. Returns the task id to poll. The anesthesia fields in schedule drive modifier and qualifying-circumstance decisions, so send every field you have.","operationId":"submitCodingTask","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodingTaskRequest"}}},"required":true}}},"/autocoding/v1/tasks/{id}":{"get":{"tags":["tasks"],"summary":"Poll a coding task by id.","responses":{"200":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/CodingTaskResult"}}},"description":"The task envelope with state and, when Completed, the result."},"401":{"description":"Missing or invalid x-api-key."},"404":{"description":"No task with this id for your organization."}},"parameters":[{"in":"path","name":"id","schema":{"type":"string"},"required":true,"description":"The task id returned by the POST."}],"description":"Returns the task state (In-Progress, Completed, or Error) and, when Completed, the coded line items with per-code confidence. Poll at a modest interval, for example every 5 to 15 seconds.","operationId":"getCodingTask"}}},"openapi":"3.1.0","servers":[{"url":"https://services.hank.ai"}],"security":[{"ApiKeyAuth":[]}],"components":{"schemas":{"Meta":{"type":"object","properties":{"squash_icd":{"type":"boolean","description":"Collapse duplicate ICD codes across line items."},"note_classification":{"type":"boolean","description":"Run note classification before coding."}}},"Phone":{"type":"object","properties":{"type":{"type":"string","description":"The number kind, for example home."},"number":{"type":"string"}}},"Address":{"type":"object","properties":{"zip":{"type":"string"},"city":{"type":"string"},"state":{"type":"string"},"street1":{"type":"string"},"street2":{"type":"string"}}},"Provider":{"type":"object","properties":{"name":{"type":"string","description":"The provider or billing-service name."},"facility":{"type":"string","description":"The facility name."},"correlation_id":{"type":"string","description":"Your internal ID, echoed back in the result."}}},"Schedule":{"type":"object","properties":{"asa":{"type":"string","description":"ASA physical status, 1 to 6. Drives the P1 to P6 modifiers."},"date":{"type":"string","description":"Date of service."},"room":{"type":"string"},"anType":{"type":"string","description":"Anesthesia type."},"endTime":{"type":"string","description":"Anesthesia end time."},"preNote":{"type":"string"},"surgeon":{"type":"string"},"emergent":{"enum":["0","1"],"type":"string","description":"Emergency flag. Drives 99140."},"postNote":{"type":"string"},"recSigned":{"type":"string"},"startTime":{"type":"string","description":"Anesthesia start time."},"surgeonNPI":{"type":"string","description":"The surgeon NPI."},"anesthesiaStaff":{"type":"string"},"anesthesiologist":{"type":"string"},"difficultIntubation":{"enum":["Yes","No"],"type":"string"}},"description":"Case context. The anesthesia fields drive modifier and qualifying-circumstance coding."},"InputEntity":{"type":"object","required":["inputType","noteType","content"],"properties":{"content":{"type":"string","description":"The document text."},"noteType":{"enum":["SurgeonProcedureNote","AnesthesiaProcedureNote","AnesthesiaPreoperativeNote","DiagnosisDescription","SurgeryDescription","AnesthesiaProcedureNote_AirwayPlacement","AnesthesiaProcedureNote_LaborEpidural","AnesthesiaProcedureNote_ArterialLine","AnesthesiaProcedureNote_NerveBlock","AnesthesiaProcedureNote_EpiduralCatheterNonOB","AnesthesiaProcedureNote_CentralLine"],"type":"string","description":"The kind of clinical document."},"inputType":{"enum":["text"],"type":"string","description":"The content encoding."},"lastModifiedTime":{"type":"string","description":"When the document last changed."}}},"PatientInfo":{"type":"object","properties":{"patient":{"type":"object","properties":{"dob":{"type":"string","description":"Date of birth."},"mrn":{"type":"string","description":"Medical record number."},"sex":{"enum":["M","F"],"type":"string"},"accn":{"type":"string","description":"Account number."},"encn":{"type":"string","description":"Encounter number."},"last":{"type":"string"},"first":{"type":"string"},"phone":{"type":"array","items":{"$ref":"#/components/schemas/Phone"}},"middle":{"type":"string"},"address":{"type":"array","items":{"$ref":"#/components/schemas/Address"}},"fullName":{"type":"string"}}},"guarantor":{"type":"array","items":{"type":"object","properties":{"last":{"type":"string"},"first":{"type":"string"},"phone":{"type":"array","items":{"$ref":"#/components/schemas/Phone"}},"middle":{"type":"string"},"address":{"type":"array","items":{"$ref":"#/components/schemas/Address"}},"fullName":{"type":"string"},"relationship":{"type":"string","description":"Relationship to the patient."}}}},"insurance":{"type":"array","items":{"type":"object","properties":{"phone":{"type":"string"},"address":{"$ref":"#/components/schemas/Address"},"company":{"type":"string"},"groupId":{"type":"string"},"phoneExt":{"type":"string"},"policyId":{"type":"string"},"priority":{"type":"string"}}},"description":"One entry per policy, ordered by priority."}}},"ResultEntity":{"type":"object","properties":{"entity":{"type":"object","properties":{"id":{"type":"string","description":"Unique within the request."},"type":{"enum":["SurgCPT","AnesCPT","ICD10","Modifier","Practitioner"],"type":"string"},"order":{"type":"number","description":"Position within the type."},"provider":{"type":"string","description":"The provider the line item belongs to."},"entityValue":{"type":"array","items":{"type":"object","properties":{"id":{"type":"string"},"code":{"type":["number","string"],"description":"The code value."},"noteId":{"type":"number","description":"The source document reference."},"noteType":{"type":"string","description":"The source document kind."},"confidence":{"type":"number","maximum":1,"minimum":0}}},"description":"The codes of this line item's type, in order."},"Line_item_number":{"type":"number","description":"The claim line number."}}}}},"CodingTaskResult":{"type":"object","properties":{"id":{"type":"string"},"error":{"type":["object","string","null"],"description":"Present when state is Error."},"state":{"enum":["In-Progress","Completed","Error"],"type":"string"},"status":{"type":["string","null"]},"metadata":{"type":"object","properties":{"timeStamp":{"type":"string"},"processEndTime":{"type":"string"},"processStartTime":{"type":"string"}}},"response":{"type":"object","properties":{"result":{"type":"object","properties":{"job_id":{"type":"string","description":"Your internal id from the POST, if supplied."},"entities":{"type":"array","items":{"$ref":"#/components/schemas/ResultEntity"},"description":"One entry per coded line item."}}}}}}},"CodingTaskRequest":{"type":"object","required":["request"],"properties":{"Name":{"type":"string","description":"A label for this submission."},"request":{"type":"object","required":["job"],"properties":{"job":{"type":"object","required":["input"],"properties":{"id":{"type":"string","description":"Your optional internal id. The result echoes it back as job_id."},"meta":{"$ref":"#/components/schemas/Meta"},"input":{"type":"object","required":["entities"],"properties":{"entities":{"type":"array","items":{"$ref":"#/components/schemas/InputEntity"},"description":"One entry per clinical document."}}},"provider":{"$ref":"#/components/schemas/Provider"},"schedule":{"$ref":"#/components/schemas/Schedule"},"patient_info":{"$ref":"#/components/schemas/PatientInfo"}}},"service":{"type":"string","description":"Reference to the service."}}}}},"CodingTaskAccepted":{"type":"object","properties":{"id":{"type":"string","description":"The task id to poll."},"metadata":{"type":"object","properties":{"timeStamp":{"type":"string"},"apiVersion":{"type":"string"}}}}}},"securitySchemes":{"ApiKeyAuth":{"in":"header","name":"x-api-key","type":"apiKey","description":"Per-customer API key provisioned by your Hank.ai representative. Keep it server-side."}}}}