public InvestigationsForAttendVo save(InvestigationsForAttendVo record)
      throws StaleObjectException {
    if (record == null)
      throw new CodingRuntimeException("Cannot save a null InvestigationsForAttendVo");

    if (!record.isValidated())
      throw new CodingRuntimeException("InvestigationsForAttendVo is not validated.");

    DomainFactory factory = getDomainFactory();

    InvestigationsForAttend doInvestigationsForAttend =
        InvestigationsForAttendVoAssembler.extractInvestigationsForAttend(factory, record);
    factory.save(doInvestigationsForAttend);

    return InvestigationsForAttendVoAssembler.create(doInvestigationsForAttend);
  }
  public InvestigationsForAttendVo getInvestigationsForAttend(CareContextRefVo careContext) {
    DomainFactory factory = getDomainFactory();
    String query =
        "select ifa from InvestigationsForAttend as ifa left join ifa.attendance as cc where cc.id = :AttendenceId ";

    List<?> list =
        factory.find(
            query, new String[] {"AttendenceId"}, new Object[] {careContext.getID_CareContext()});

    if (list == null || list.size() == 0) return null;

    return InvestigationsForAttendVoAssembler.create((InvestigationsForAttend) list.get(0));
  }