mirror of
https://dev.azure.com/globalhealthx/EMR/_git/helix-engage-server
synced 2026-05-18 20:08:19 +00:00
fix: set platform name on every entity create — patients/appts/calls/etc no longer "Untitled"
Audited all 23 sidecar create-mutation call sites; 7 were missing the top-level data.name field that the platform uses as record title: - caller-resolution.service.ts createPatient — full name from first/last - maint.controller.ts createPatient (backfill-lead-patient-links) — same - widget.service.ts createPatient (chat path + booking path) — full name - widget.service.ts createAppointment — "<Patient> — <date>" - worklist/missed-queue.service.ts createCall — "Missed — <phone>" - rules-engine/actions/escalate.action.ts createPerformanceAlert — "<agent>: <message> (<value>)" - supervisor/agent-history.service.ts createAgentEvent / createAgentSession Cosmetic only — the app fetches fullName/agentName for display, so end users never saw "Untitled". Fixes platform-side admin browsing. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -165,6 +165,7 @@ export class CallerResolutionService {
|
|||||||
`mutation($data: PatientCreateInput!) { createPatient(data: $data) { id } }`,
|
`mutation($data: PatientCreateInput!) { createPatient(data: $data) { id } }`,
|
||||||
{
|
{
|
||||||
data: {
|
data: {
|
||||||
|
name: `${firstName || 'Unknown'} ${lastName || ''}`.trim(),
|
||||||
fullName: { firstName: firstName || 'Unknown', lastName: lastName || '' },
|
fullName: { firstName: firstName || 'Unknown', lastName: lastName || '' },
|
||||||
phones: { primaryPhoneNumber: `+91${phone}` },
|
phones: { primaryPhoneNumber: `+91${phone}` },
|
||||||
patientType: 'NEW',
|
patientType: 'NEW',
|
||||||
|
|||||||
@@ -277,6 +277,7 @@ export class MaintController {
|
|||||||
`mutation($data: PatientCreateInput!) { createPatient(data: $data) { id } }`,
|
`mutation($data: PatientCreateInput!) { createPatient(data: $data) { id } }`,
|
||||||
{
|
{
|
||||||
data: {
|
data: {
|
||||||
|
name: `${firstName} ${lastName}`.trim(),
|
||||||
fullName: { firstName, lastName },
|
fullName: { firstName, lastName },
|
||||||
phones: { primaryPhoneNumber: `+91${phone}` },
|
phones: { primaryPhoneNumber: `+91${phone}` },
|
||||||
patientType: 'NEW',
|
patientType: 'NEW',
|
||||||
|
|||||||
@@ -60,6 +60,7 @@ export class EscalateActionHandler implements ActionHandler {
|
|||||||
`mutation($data: PerformanceAlertCreateInput!) { createPerformanceAlert(data: $data) { id } }`,
|
`mutation($data: PerformanceAlertCreateInput!) { createPerformanceAlert(data: $data) { id } }`,
|
||||||
{
|
{
|
||||||
data: {
|
data: {
|
||||||
|
name: `${agentName || agentId}: ${params.message ?? alertType}${valueText ? ` (${valueText})` : ''}`,
|
||||||
agentId,
|
agentId,
|
||||||
alertType,
|
alertType,
|
||||||
severity,
|
severity,
|
||||||
|
|||||||
@@ -154,6 +154,7 @@ export class AgentHistoryService implements OnModuleInit {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const data: Record<string, any> = {
|
const data: Record<string, any> = {
|
||||||
|
name: `${params.ozonetelAgentId} ${params.eventType}`,
|
||||||
eventType: params.eventType,
|
eventType: params.eventType,
|
||||||
eventAt: params.eventAt,
|
eventAt: params.eventAt,
|
||||||
source: 'OZONETEL_SUBSCRIPTION',
|
source: 'OZONETEL_SUBSCRIPTION',
|
||||||
@@ -373,7 +374,7 @@ export class AgentHistoryService implements OnModuleInit {
|
|||||||
} else {
|
} else {
|
||||||
await this.platform.query<any>(
|
await this.platform.query<any>(
|
||||||
`mutation($data: AgentSessionCreateInput!) { createAgentSession(data: $data) { id } }`,
|
`mutation($data: AgentSessionCreateInput!) { createAgentSession(data: $data) { id } }`,
|
||||||
{ data: { ...data, agentId: agentUuid, date: sessionDate } },
|
{ data: { ...data, name: `Session ${sessionDate}`, agentId: agentUuid, date: sessionDate } },
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -65,6 +65,7 @@ export class WidgetService {
|
|||||||
`mutation($data: PatientCreateInput!) { createPatient(data: $data) { id } }`,
|
`mutation($data: PatientCreateInput!) { createPatient(data: $data) { id } }`,
|
||||||
{
|
{
|
||||||
data: {
|
data: {
|
||||||
|
name: `${firstName} ${lastName}`.trim() || 'Unknown',
|
||||||
fullName: { firstName, lastName },
|
fullName: { firstName, lastName },
|
||||||
phones: { primaryPhoneNumber: `+91${phone}` },
|
phones: { primaryPhoneNumber: `+91${phone}` },
|
||||||
patientType: 'NEW',
|
patientType: 'NEW',
|
||||||
@@ -219,6 +220,7 @@ export class WidgetService {
|
|||||||
const created = await this.platform.queryWithAuth<any>(
|
const created = await this.platform.queryWithAuth<any>(
|
||||||
`mutation($data: PatientCreateInput!) { createPatient(data: $data) { id } }`,
|
`mutation($data: PatientCreateInput!) { createPatient(data: $data) { id } }`,
|
||||||
{ data: {
|
{ data: {
|
||||||
|
name: req.patientName.trim() || 'Unknown',
|
||||||
fullName: { firstName, lastName },
|
fullName: { firstName, lastName },
|
||||||
phones: { primaryPhoneNumber: `+91${phone}` },
|
phones: { primaryPhoneNumber: `+91${phone}` },
|
||||||
patientType: 'NEW',
|
patientType: 'NEW',
|
||||||
@@ -232,6 +234,7 @@ export class WidgetService {
|
|||||||
const appt = await this.platform.queryWithAuth<any>(
|
const appt = await this.platform.queryWithAuth<any>(
|
||||||
`mutation($data: AppointmentCreateInput!) { createAppointment(data: $data) { id } }`,
|
`mutation($data: AppointmentCreateInput!) { createAppointment(data: $data) { id } }`,
|
||||||
{ data: {
|
{ data: {
|
||||||
|
name: `${req.patientName.trim() || 'Patient'} — ${new Date(req.scheduledAt).toISOString().slice(0, 10)}`,
|
||||||
scheduledAt: req.scheduledAt,
|
scheduledAt: req.scheduledAt,
|
||||||
durationMin: 30,
|
durationMin: 30,
|
||||||
appointmentType: 'CONSULTATION',
|
appointmentType: 'CONSULTATION',
|
||||||
|
|||||||
@@ -142,6 +142,7 @@ export class MissedQueueService implements OnModuleInit {
|
|||||||
this.logger.log(`Dedup missed call ${phone}: count now ${newCount}${leadName ? ` (${leadName})` : ''}`);
|
this.logger.log(`Dedup missed call ${phone}: count now ${newCount}${leadName ? ` (${leadName})` : ''}`);
|
||||||
} else {
|
} else {
|
||||||
const dataParts = [
|
const dataParts = [
|
||||||
|
`name: "Missed — ${phone}"`,
|
||||||
`callStatus: MISSED`,
|
`callStatus: MISSED`,
|
||||||
`direction: INBOUND`,
|
`direction: INBOUND`,
|
||||||
`callerNumber: { primaryPhoneNumber: "${phone}", primaryPhoneCallingCode: "+91" }`,
|
`callerNumber: { primaryPhoneNumber: "${phone}", primaryPhoneCallingCode: "+91" }`,
|
||||||
|
|||||||
Reference in New Issue
Block a user