Exemplo n.º 1
0
TYPEMAKER2_INLINE *Typemaker2_Inline_fromXml(GWEN_XMLNODE *node) {
  TYPEMAKER2_INLINE *th;
  const char *s;

  th=Typemaker2_Inline_new();

  s=GWEN_XMLNode_GetCharValue(node, "content", NULL);
  Typemaker2_Inline_SetContent(th, s);

  s=GWEN_XMLNode_GetCharValue(node, "typeFlagsMask", NULL);
  if (s && *s)
    th->typeFlagsMask=Typemaker2_FlagsFromString(s);

  s=GWEN_XMLNode_GetCharValue(node, "typeFlagsValue", NULL);
  if (s && *s)
    th->typeFlagsValue=Typemaker2_FlagsFromString(s);

  /* read header location */
  s=GWEN_XMLNode_GetProperty(node, "loc", "post");
  if (strcasecmp(s, "header")==0)
    Typemaker2_Inline_SetLocation(th, Typemaker2_InlineLocation_Header);
  else if (strcasecmp(s, "code")==0)
    Typemaker2_Inline_SetLocation(th, Typemaker2_InlineLocation_Code);

  /* read access */
  s=GWEN_XMLNode_GetProperty(node, "access", "public");
  Typemaker2_Inline_SetAccess(th, Typemaker2_AccessFromString(s));

  return th;
}
Exemplo n.º 2
0
AB_VALUE *AB_ImExporterYN__ReadValue(AB_IMEXPORTER *ie,
                                     GWEN_XMLNODE *node,
                                     int value)
{
  GWEN_XMLNODE *n;
  AB_VALUE *val=0;

  n=GWEN_XMLNode_FindFirstTag(node, "C516", 0, 0);
  if (n) {
    GWEN_XMLNODE *nn;
    int v=0;

    nn=GWEN_XMLNode_FindFirstTag(n, "D_5025", 0, 0);
    if (nn)
      v=atoi(GWEN_XMLNode_GetProperty(nn, "Value", "0"));
    if (value==0 || v==value) {
      const char *sValue;
      const char *sSign;

      sValue=GWEN_XMLNode_GetCharValue(n, "D_5004", 0);
      sSign=GWEN_XMLNode_GetCharValue(node, "PF:D_5003", 0);

      if (sValue) {
        val=AB_Value_fromString(sValue);
        if (val && sSign && strcmp(sSign, "-")==0)
          AB_Value_Negate(val);
      }
    }
  }

  return val;
}
Exemplo n.º 3
0
LC_CLIENT_RESULT LC_EgkCard_ReadPersonalData_old(GWEN_XMLNODE *n,
						 LC_HI_PERSONAL_DATA *d) {
  const char *s;
  GWEN_XMLNODE *nn;
  
  s=GWEN_XMLNode_GetCharValue(n, "Versicherten_ID", NULL);
  LC_HIPersonalData_SetInsuranceId(d, s);
  
  s=GWEN_XMLNode_GetCharValue(n, "Geburtsdatum", NULL);
  if (s) {
    GWEN_TIME *ti=GWEN_Time_fromUtcString(s, "YYYYMMDD");
    LC_HIPersonalData_SetDateOfBirth(d, ti);
    GWEN_Time_free(ti);
  }
  s=GWEN_XMLNode_GetCharValue(n, "Vorname", NULL);
  LC_HIPersonalData_SetPrename(d, s);
  s=GWEN_XMLNode_GetCharValue(n, "Nachname", NULL);
  LC_HIPersonalData_SetName(d, s);
  s=GWEN_XMLNode_GetCharValue(n, "Sex", "1");
  if (s) {
    if (strcasecmp(s, "1")==0)
      LC_HIPersonalData_SetSex(d, LC_HIPersonalData_SexMale);
    else if (strcasecmp(s, "2")==0)
      LC_HIPersonalData_SetSex(d, LC_HIPersonalData_SexFemale);
    else {
      DBG_WARN(LC_LOGDOMAIN, "Unknown sex \"%s\"", s);
    }
  }
  
  nn=GWEN_XMLNode_FindFirstTag(n,
			       "Anschrift",
			       NULL, NULL);
  if (nn) {
    s=GWEN_XMLNode_GetCharValue(nn, "Postleitzahl", NULL);
    LC_HIPersonalData_SetAddrZipCode(d, s);
    s=GWEN_XMLNode_GetCharValue(nn, "Ort", NULL);
    LC_HIPersonalData_SetAddrCity(d, s);
    s=GWEN_XMLNode_GetCharValue(nn, "Wohnsitzlaendercode", NULL);
    LC_HIPersonalData_SetAddrCountry(d, s);
    nn=GWEN_XMLNode_FindFirstTag(nn,
				 "Adresse",
				 NULL, NULL);
    if (nn) {
      s=GWEN_XMLNode_GetCharValue(nn, "Strasse", NULL);
      LC_HIPersonalData_SetAddrStreet(d, s);
      s=GWEN_XMLNode_GetCharValue(nn, "Hausnummer", NULL);
      LC_HIPersonalData_SetAddrHouseNum(d, s);
    }
  }

  return LC_Client_ResultOk;
}
Exemplo n.º 4
0
GWEN_DATE *AB_ImExporterYN__ReadDate(AB_IMEXPORTER *ie, GWEN_XMLNODE *node, int value)
{
  GWEN_XMLNODE *n;
  GWEN_DATE *da=NULL;

  n=GWEN_XMLNode_GetNodeByXPath(node, "C507", GWEN_PATH_FLAGS_NAMEMUSTEXIST);
  if (n) {
    GWEN_XMLNODE *nn;
    int v=0;

    nn=GWEN_XMLNode_FindFirstTag(n, "D_2005", 0, 0);
    if (nn)
      v=atoi(GWEN_XMLNode_GetProperty(nn, "Value", "0"));

    if (value==0 || v==value) {
      const char *s;

      s=GWEN_XMLNode_GetCharValue(n, "D_2380", 0);
      if (s)
        da=GWEN_Date_fromStringWithTemplate(s, "YYYYMMDD");
    }
  }

  return da;
}
Exemplo n.º 5
0
GWEN_TIME *AB_ImExporterYN__ReadTime(AB_IMEXPORTER *ie,
				     GWEN_XMLNODE *node,
				     int value) {
  GWEN_XMLNODE *n;
  GWEN_TIME *ti=0;

  n=GWEN_XMLNode_GetNodeByXPath(node, "C507",
				GWEN_PATH_FLAGS_NAMEMUSTEXIST);
  if (n) {
    GWEN_XMLNODE *nn;
    int v=0;

    nn=GWEN_XMLNode_FindFirstTag(n, "D_2005", 0, 0);
    if (nn)
      v=atoi(GWEN_XMLNode_GetProperty(nn, "Value", "0"));

    if (value==0 || v==value) {
      const char *s;

      s=GWEN_XMLNode_GetCharValue(n, "D_2380", 0);
      if (s)
	ti=AB_ImExporter_DateFromString(s, "YYYYMMDD", 0);
    }
  }

  return ti;
}
Exemplo n.º 6
0
int GWEN_XMLNode_GetIntValue(const GWEN_XMLNODE *n,
                             const char *name,
                             int defValue) {
  const char *p;
  int res;

  p=GWEN_XMLNode_GetCharValue(n, name, 0);
  if (!p)
    return defValue;
  if (1!=sscanf(p, "%i", &res))
    return defValue;
  return res;
}
Exemplo n.º 7
0
LC_CLIENT_RESULT LC_EgkCard_ReadInsuranceData_5_1_0(GWEN_XMLNODE *n,
						    LC_HI_INSURANCE_DATA *d) {
  const char *s;
  GWEN_XMLNODE *nn;

  n=GWEN_XMLNode_FindFirstTag(n,
			      "Versicherter",
			      NULL, NULL);
  if (n) {
    nn=GWEN_XMLNode_FindFirstTag(n,
				 "Versicherungsschutz",
				 NULL, NULL);
    if (nn) {
      GWEN_XMLNODE *nnn;

      s=GWEN_XMLNode_GetCharValue(nn, "Beginn", NULL);
      if (s) {
	GWEN_TIME *ti=GWEN_Time_fromUtcString(s, "YYYYMMDD");
	LC_HIInsuranceData_SetCoverBegin(d, ti);
	GWEN_Time_free(ti);
      }
      s=GWEN_XMLNode_GetCharValue(nn, "Ende", NULL);
      if (s) {
	GWEN_TIME *ti=GWEN_Time_fromUtcString(s, "YYYYMMDD");
	LC_HIInsuranceData_SetCoverEnd(d, ti);
	GWEN_Time_free(ti);
      }

      nnn=GWEN_XMLNode_FindFirstTag(nn,
				    "Kostentraeger",
				    NULL, NULL);
      if (nnn) {
	s=GWEN_XMLNode_GetCharValue(nnn, "Kostentraegerkennung", NULL);
	LC_HIInsuranceData_SetInstitutionId(d, s);
	s=GWEN_XMLNode_GetCharValue(nnn, "Name", NULL);
	LC_HIInsuranceData_SetInstitutionName(d, s);
      }
    }
    else {
      DBG_INFO(LC_LOGDOMAIN,
	       "XML element \"Versicherungsschutz\" not found");
    }
    nn=GWEN_XMLNode_FindFirstTag(n,
				 "Zusatzinfos",
				 NULL, NULL);
    if (nn)
      nn=GWEN_XMLNode_FindFirstTag(nn,
				   "ZusatzinfosGKV",
				   NULL, NULL);
    if (nn) {
      s=GWEN_XMLNode_GetCharValue(nn, "Rechtskreis", NULL);
      LC_HIInsuranceData_SetGroup(d, s);
      s=GWEN_XMLNode_GetCharValue(nn, "Versichertenart", NULL);
      LC_HIInsuranceData_SetStatus(d, s);
    }
  }

  return LC_Client_ResultOk;
}
Exemplo n.º 8
0
AB_IMEXPORTER_ACCOUNTINFO *AB_ImExporterYN__ReadAccountInfo(AB_IMEXPORTER *ie,
                                                            AB_IMEXPORTER_CONTEXT *ctx,
                                                            GWEN_XMLNODE *doc)
{
  GWEN_XMLNODE *n;
  AB_IMEXPORTER_ACCOUNTINFO *ai;

  ai=AB_ImExporterAccountInfo_new();

  n=GWEN_XMLNode_FindFirstTag(doc, "SG2", 0, 0);
  if (n)
    n=GWEN_XMLNode_FindFirstTag(n, "FII", 0, 0);
  if (n) {
    GWEN_XMLNODE *nn;
    const char *s;

    nn=GWEN_XMLNode_FindFirstTag(n, "C078", 0, 0);
    if (nn) {
      GWEN_XMLNODE *nnn;

      /* account number */
      s=GWEN_XMLNode_GetCharValue(nn, "D_3194", 0);
      if (s)
        AB_ImExporterAccountInfo_SetAccountNumber(ai, s);
      /* IBAN */
      s=GWEN_XMLNode_GetCharValue(nn, "D_3192", 0);
      if (s)
        AB_ImExporterAccountInfo_SetIban(ai, s);
      /* currency */
      nnn=GWEN_XMLNode_FindFirstTag(nn, "D_6345", 0, 0);
      if (nnn) {
        s=GWEN_XMLNode_GetProperty(nnn, "value", 0);
        if (s)
          AB_ImExporterAccountInfo_SetCurrency(ai, s);
      }
    }

    /* account number */
    s=GWEN_XMLNode_GetCharValue(n, "PF:D_5388", 0);
    if (s)
      AB_ImExporterAccountInfo_SetAccountName(ai, s);
  }

  /* owner name */
  n=GWEN_XMLNode_GetNodeByXPath(doc, "SG3[1]/NAD",
                                GWEN_PATH_FLAGS_NAMEMUSTEXIST);
  if (n) {
    GWEN_XMLNODE *nn;

    nn=GWEN_XMLNode_FindFirstTag(n, "D_3035", 0, 0);
    if (nn) {
      const char *s;

      s=GWEN_XMLNode_GetProperty(nn, "Value", 0);
      if (s && strcasecmp(s, "HQ")==0) {
        nn=GWEN_XMLNode_FindFirstTag(n, "C058", 0, 0);
        if (nn) {
          s=GWEN_XMLNode_GetCharValue(nn, "D_3124", 0);
          if (s && *s) {
            GWEN_BUFFER *xbuf;

            xbuf=GWEN_Buffer_new(0, 256, 0, 1);
            AB_ImExporter_Iso8859_1ToUtf8(s, strlen(s), xbuf);
            AB_ImExporterAccountInfo_SetOwner(ai, GWEN_Buffer_GetStart(xbuf));
            GWEN_Buffer_free(xbuf);
          }
        }
      }
    }
  }

  return ai;
}
Exemplo n.º 9
0
void GWEN_Param_ReadXml(GWEN_PARAM *p_struct, GWEN_XMLNODE *p_db)
{
  assert(p_struct);
  /* member "name" */
  if (p_struct->name) {
    free(p_struct->name);
  }
  {
    const char *s;
    s=GWEN_XMLNode_GetCharValue(p_db, "name", NULL);
    if (s)
      p_struct->name=strdup(s);
  }
  if (p_struct->name==NULL) {  /* member "name" is volatile, just presetting */
    p_struct->name=NULL;
  }

  /* member "flags" */
  p_struct->flags=GWEN_XMLNode_GetIntValue(p_db, "flags", 0);

  /* member "type" */
  {
    const char *s;
    s=GWEN_XMLNode_GetCharValue(p_db, "type", NULL);
    if (s)
      p_struct->type=GWEN_Param_Type_fromString(s);
    else
      p_struct->type=GWEN_Param_Type_Unknown;
  }

  /* member "dataType" */
  {
    const char *s;
    s=GWEN_XMLNode_GetCharValue(p_db, "dataType", NULL);
    if (s)
      p_struct->dataType=GWEN_Param_DataType_fromString(s);
    else
      p_struct->dataType=GWEN_Param_DataType_Unknown;
  }

  /* member "shortDescription" */
  if (p_struct->shortDescription) {
    free(p_struct->shortDescription);
  }
  {
    const char *s;
    s=GWEN_XMLNode_GetCharValue(p_db, "shortDescription", NULL);
    if (s)
      p_struct->shortDescription=strdup(s);
  }
  if (p_struct->shortDescription==NULL) {  /* member "shortDescription" is volatile, just presetting */
    p_struct->shortDescription=NULL;
  }

  /* member "longDescription" */
  if (p_struct->longDescription) {
    free(p_struct->longDescription);
  }
  {
    const char *s;
    s=GWEN_XMLNode_GetCharValue(p_db, "longDescription", NULL);
    if (s)
      p_struct->longDescription=strdup(s);
  }
  if (p_struct->longDescription==NULL) {  /* member "longDescription" is volatile, just presetting */
    p_struct->longDescription=NULL;
  }

  /* member "currentValue" */
  if (p_struct->currentValue) {
    free(p_struct->currentValue);
  }
  {
    const char *s;
    s=GWEN_XMLNode_GetCharValue(p_db, "currentValue", NULL);
    if (s)
      p_struct->currentValue=strdup(s);
  }
  if (p_struct->currentValue==NULL) {  /* member "currentValue" is volatile, just presetting */
    p_struct->currentValue=NULL;
  }

  /* member "defaultValue" */
  if (p_struct->defaultValue) {
    free(p_struct->defaultValue);
  }
  {
    const char *s;
    s=GWEN_XMLNode_GetCharValue(p_db, "defaultValue", NULL);
    if (s)
      p_struct->defaultValue=strdup(s);
  }
  if (p_struct->defaultValue==NULL) {  /* member "defaultValue" is volatile, just presetting */
    p_struct->defaultValue=NULL;
  }

  /* member "choices" */
  if (p_struct->choices) {
    GWEN_StringList2_free(p_struct->choices);
  }
  {
    GWEN_XMLNODE *n;
    n=GWEN_XMLNode_FindFirstTag(p_db, "choices", 0, 0);
    if (n) {
      p_struct->choices=GWEN_StringList2_fromXml(n, GWEN_StringList2_IntertMode_AlwaysAdd);
    }
    else
      p_struct->choices=NULL;
  }
  if (p_struct->choices==NULL) {  /* member "choices" is volatile, just presetting */
    p_struct->choices=NULL;
  }

  /* member "internalIntValue" */
  /* member "internalIntValue" is volatile, just presetting */
  p_struct->internalIntValue=0;

  /* member "internalFloatValue" */
  /* member "internalFloatValue" is volatile, just presetting */
  p_struct->internalFloatValue=0;

  /* member "runtimeFlags" */
  /* member "runtimeFlags" is volatile, just presetting */
  p_struct->runtimeFlags=0;

}