export const systemCode = 'system'

export const rehabInstCode = 'rehab'
export const rehabUnitCode = 'rehab'

export const headPosCode = 'head' // head position
export const respPosCode = 'resp' // responsible position, verificator

export type UnitLevel =
  'inst' | // installation
  'unit' | // unit / poly
  'spec' | // specialist
  'subspec' // subspecialist

export const medicalRoles = [
  'emp|doc', // doctor
  'emp|nur', // nurse
  'emp|miw', // midwife
  'emp|thr', // therapist
  'emp|nut', // nutritionist
  'emp|pha', // pharmacy
  'emp|lab'  // laborant
]

export const serviceRoles = [
  'emp|reg',
  ...medicalRoles,
]

export function genSpecHeadCode(unit_level: UnitLevel, unit_code: string): string {
  return `${unit_level}|${unit_code}|${headPosCode}`
}

export function genUnitRespCode(unit_level: UnitLevel, unit_code: string): string {
  return `${unit_level}|${unit_code}|${respPosCode}`
}
