Best Gherkin-php code snippet using StringUtils
AbstractGeocode.cs
Source:AbstractGeocode.cs
...362 }363 public virtual string AsStringVerbose_V03_01(string separator, double version, BatchOptions options)364 {365 StringBuilder sb = new StringBuilder();366 sb.Append("\"" + StringUtils.EscapeChar(Latitude.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //3367 sb.Append("\"" + StringUtils.EscapeChar(Longitude.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //4368 sb.Append("\"" + StringUtils.EscapeChar(NAACCRGISCoordinateQualityCode, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //5369 sb.Append("\"" + StringUtils.EscapeChar(NAACCRGISCoordinateQualityType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //6370 sb.Append("\"" + StringUtils.EscapeChar(MatchScore.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //7371 sb.Append("\"" + StringUtils.EscapeChar(MatchType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //8372 sb.Append("\"" + StringUtils.EscapeChar(FM_GeographyType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //9373 sb.Append("\"" + StringUtils.EscapeChar(RegionSize, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //10374 sb.Append("\"" + StringUtils.EscapeChar(RegionSizeUnits, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //11375 sb.Append("\"" + StringUtils.EscapeChar(InterpolationType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //12376 sb.Append("\"" + StringUtils.EscapeChar(InterpolationSubType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //13377 sb.Append("\"" + StringUtils.EscapeChar(MatchedLocationType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //14378 sb.Append("\"" + StringUtils.EscapeChar(FM_ResultType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //15379 sb.Append("\"" + StringUtils.EscapeChar(FM_ResultCount.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //16380 sb.Append("\"" + StringUtils.EscapeChar(FM_Notes, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //17381 sb.Append("\"" + StringUtils.EscapeChar(FM_TieNotes, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //18382 sb.Append("\"" + StringUtils.EscapeChar(FM_TieStrategy.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //19383 sb.Append("\"" + StringUtils.EscapeChar(FM_SelectionMethod.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //20384 sb.Append("\"" + StringUtils.EscapeChar(FM_SelectionNotes, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21385 if (options == null || options.OutputBookKeepingFieldMappings.Enabled)386 {387 sb.Append("\"" + StringUtils.EscapeChar(Version.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21388 sb.Append("\"" + StringUtils.EscapeChar(QueryStatusCodes.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //2389 sb.Append("\"" + StringUtils.EscapeChar(TimeTaken.TotalMilliseconds.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21390 sb.Append("\"" + StringUtils.EscapeChar(TransactionId, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21391 sb.Append("\"" + StringUtils.EscapeChar(GeocoderName, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21392 sb.Append("\"" + StringUtils.EscapeChar(ErrorMessage, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21393 sb.Append("\"" + StringUtils.EscapeChar(1.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21394 sb.Append("\"" + StringUtils.EscapeChar(RecordId, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21395 }396 if (options == null || options.OutputCensusFieldMappings.Enabled)397 {398 sb.Append("\"" + StringUtils.EscapeChar(CensusYear.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //23399 sb.Append("\"" + StringUtils.EscapeChar(NAACCRCensusTractCertaintyCode, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //24400 sb.Append("\"" + StringUtils.EscapeChar(NAACCRCensusTractCertaintyType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //25401 sb.Append("\"" + StringUtils.EscapeChar(CensusBlock, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //26402 sb.Append("\"" + StringUtils.EscapeChar(CensusBlockGroup, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //27403 sb.Append("\"" + StringUtils.EscapeChar(CensusTract, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //28404 sb.Append("\"" + StringUtils.EscapeChar(CensusCountyFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //29405 sb.Append("\"" + StringUtils.EscapeChar(CensusCbsaFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //30406 sb.Append("\"" + StringUtils.EscapeChar(CensusCbsaMicro, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //31407 sb.Append("\"" + StringUtils.EscapeChar(CensusMcdFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //32408 sb.Append("\"" + StringUtils.EscapeChar(CensusMetDivFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //33409 sb.Append("\"" + StringUtils.EscapeChar(CensusMsaFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //34410 sb.Append("\"" + StringUtils.EscapeChar(CensusPlaceFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //35411 sb.Append("\"" + StringUtils.EscapeChar(CensusStateFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //36412 }413 if (options == null || options.OutputInputAddressFieldMappings.Enabled)414 {415 StreetAddress address = InputAddress;416 sb.Append("\"" + StringUtils.EscapeChar(address.Number, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //37417 sb.Append("\"" + StringUtils.EscapeChar(address.NumberFractional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //38418 sb.Append("\"" + StringUtils.EscapeChar(address.PreDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //39419 sb.Append("\"" + StringUtils.EscapeChar(address.PreQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //40420 sb.Append("\"" + StringUtils.EscapeChar(address.PreType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //41421 sb.Append("\"" + StringUtils.EscapeChar(address.PreArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //42422 sb.Append("\"" + StringUtils.EscapeChar(address.StreetName, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //43423 sb.Append("\"" + StringUtils.EscapeChar(address.PostArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //44424 sb.Append("\"" + StringUtils.EscapeChar(address.PostQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //45425 sb.Append("\"" + StringUtils.EscapeChar(address.Suffix, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //46426 sb.Append("\"" + StringUtils.EscapeChar(address.PostDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //47427 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //48428 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //49429 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //50430 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //51431 sb.Append("\"" + StringUtils.EscapeChar(address.City, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //52432 sb.Append("\"" + StringUtils.EscapeChar(address.ConsolidatedCity, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //53433 sb.Append("\"" + StringUtils.EscapeChar(address.MinorCivilDivision, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //54434 sb.Append("\"" + StringUtils.EscapeChar(address.CountySubregion, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //55435 sb.Append("\"" + StringUtils.EscapeChar(address.County, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //56436 sb.Append("\"" + StringUtils.EscapeChar(address.State, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //57437 sb.Append("\"" + StringUtils.EscapeChar(address.ZIP, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //58438 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus1, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //59439 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus2, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //60440 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus3, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //61441 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus4, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //62442 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus5, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //63443 }444 if (options == null || options.OutputMatchedAddressFieldMappings.Enabled)445 {446 StreetAddress address = MatchedAddress;447 sb.Append("\"" + StringUtils.EscapeChar(address.Number, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //37448 sb.Append("\"" + StringUtils.EscapeChar(address.NumberFractional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //38449 sb.Append("\"" + StringUtils.EscapeChar(address.PreDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //39450 sb.Append("\"" + StringUtils.EscapeChar(address.PreQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //40451 sb.Append("\"" + StringUtils.EscapeChar(address.PreType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //41452 sb.Append("\"" + StringUtils.EscapeChar(address.PreArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //42453 sb.Append("\"" + StringUtils.EscapeChar(address.StreetName, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //43454 sb.Append("\"" + StringUtils.EscapeChar(address.PostArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //44455 sb.Append("\"" + StringUtils.EscapeChar(address.PostQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //45456 sb.Append("\"" + StringUtils.EscapeChar(address.Suffix, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //46457 sb.Append("\"" + StringUtils.EscapeChar(address.PostDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //47458 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //48459 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //49460 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //50461 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //51462 sb.Append("\"" + StringUtils.EscapeChar(address.City, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //52463 sb.Append("\"" + StringUtils.EscapeChar(address.ConsolidatedCity, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //53464 sb.Append("\"" + StringUtils.EscapeChar(address.MinorCivilDivision, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //54465 sb.Append("\"" + StringUtils.EscapeChar(address.CountySubregion, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //55466 sb.Append("\"" + StringUtils.EscapeChar(address.County, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //56467 sb.Append("\"" + StringUtils.EscapeChar(address.State, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //57468 sb.Append("\"" + StringUtils.EscapeChar(address.ZIP, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //58469 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus1, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //59470 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus2, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //60471 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus3, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //61472 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus4, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //62473 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus5, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //63474 }475 if (options == null || options.OutputParsedAddressFieldMappings.Enabled)476 {477 StreetAddress address = ParsedAddress;478 sb.Append("\"" + StringUtils.EscapeChar(address.Number, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //64479 sb.Append("\"" + StringUtils.EscapeChar(address.NumberFractional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //65480 sb.Append("\"" + StringUtils.EscapeChar(address.PreDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //66481 sb.Append("\"" + StringUtils.EscapeChar(address.PreQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //67482 sb.Append("\"" + StringUtils.EscapeChar(address.PreType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //68483 sb.Append("\"" + StringUtils.EscapeChar(address.PreArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //69484 sb.Append("\"" + StringUtils.EscapeChar(address.StreetName, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //70485 sb.Append("\"" + StringUtils.EscapeChar(address.PostArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //71486 sb.Append("\"" + StringUtils.EscapeChar(address.PostQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //72487 sb.Append("\"" + StringUtils.EscapeChar(address.Suffix, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //73488 sb.Append("\"" + StringUtils.EscapeChar(address.PostDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //74489 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //75490 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //76491 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //77492 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //78493 sb.Append("\"" + StringUtils.EscapeChar(address.City, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //79494 sb.Append("\"" + StringUtils.EscapeChar(address.ConsolidatedCity, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //80495 sb.Append("\"" + StringUtils.EscapeChar(address.MinorCivilDivision, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //81496 sb.Append("\"" + StringUtils.EscapeChar(address.CountySubregion, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //82497 sb.Append("\"" + StringUtils.EscapeChar(address.County, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //83498 sb.Append("\"" + StringUtils.EscapeChar(address.State, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //84499 sb.Append("\"" + StringUtils.EscapeChar(address.ZIP, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //85500 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus1, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //86501 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus2, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //87502 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus3, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //88503 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus4, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //89504 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus5, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //90505 }506 if (options == null || options.OutputReferenceFeatureFieldMappings.Enabled)507 {508 StreetAddress address = MatchedFeatureAddress;509 sb.Append("\"" + StringUtils.EscapeChar(address.Number, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //91510 sb.Append("\"" + StringUtils.EscapeChar(address.NumberFractional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //92511 sb.Append("\"" + StringUtils.EscapeChar(address.PreDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //93512 sb.Append("\"" + StringUtils.EscapeChar(address.PreQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //94513 sb.Append("\"" + StringUtils.EscapeChar(address.PreType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //95514 sb.Append("\"" + StringUtils.EscapeChar(address.PreArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //96515 sb.Append("\"" + StringUtils.EscapeChar(address.StreetName, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //97516 sb.Append("\"" + StringUtils.EscapeChar(address.PostArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //98517 sb.Append("\"" + StringUtils.EscapeChar(address.PostQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //99518 sb.Append("\"" + StringUtils.EscapeChar(address.Suffix, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //100519 sb.Append("\"" + StringUtils.EscapeChar(address.PostDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //101520 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //102521 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //103522 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //104523 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //105524 sb.Append("\"" + StringUtils.EscapeChar(address.City, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //106525 sb.Append("\"" + StringUtils.EscapeChar(address.ConsolidatedCity, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //107526 sb.Append("\"" + StringUtils.EscapeChar(address.MinorCivilDivision, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //108527 sb.Append("\"" + StringUtils.EscapeChar(address.CountySubregion, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //109528 sb.Append("\"" + StringUtils.EscapeChar(address.County, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //110529 sb.Append("\"" + StringUtils.EscapeChar(address.State, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //111530 sb.Append("\"" + StringUtils.EscapeChar(address.ZIP, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //112531 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus1, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //113532 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus2, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //114533 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus3, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //115534 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus4, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //116535 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus5, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //117536 if (MatchedFeature.MatchedReferenceFeature != null)537 {538 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.Area.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); ; //118539 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.AreaUnits.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); ; //119540 }541 else542 {543 sb.Append("\"\"").Append(separator); ; //118544 sb.Append("\"\"").Append(separator); ; //119545 }546 string gml = "";547 string wkt = "";548 int srid = 0;549 if (MatchedFeature != null && MatchedFeature.MatchedReferenceFeature != null)550 {551 if (MatchedFeature != null && MatchedFeature.MatchedReferenceFeature != null)552 {553 if (MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry != null)554 {555 if (MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.SqlGeometry != null && !MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.SqlGeometry.IsNull)556 {557 if (options.ShouldOutputReferenceFeatureGeometry)558 {559 srid = MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.SRID;560 //BUG:ZI140 Switching to using WKT here for simplicity and functionality561 wkt = MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.SqlGeometry.ToString();562 //gml = MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.SqlGeometry.AsGml().Value;563 }564 }565 }566 }567 }568 sb.Append("\"" + StringUtils.EscapeChar(srid.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //120569 if (String.Compare(separator, ",", true) == 0)570 {571 //BUG:ZI140 Switching to using WKT here for simplicity and functionality572 //sb.Append("\"" + StringUtils.EscapeChar(gml.Replace(separator, ";"), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //121573 sb.Append("\"" + StringUtils.EscapeChar(wkt.Replace(separator, ";"), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //121574 }575 else576 {577 //BUG:ZI140 Switching to using WKT here for simplicity and functionality578 //sb.Append("\"" + StringUtils.EscapeChar(gml, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //121579 sb.Append("\"" + StringUtils.EscapeChar(wkt, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //121580 }581 sb.Append("\"" + StringUtils.EscapeChar(SourceType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //122582 sb.Append("\"" + StringUtils.EscapeChar(SourceVintage, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //123583 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.PrimaryIdField, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //124584 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.PrimaryIdValue, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //125585 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.SecondaryIdField, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //126586 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.SecondaryIdValue, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //127587 }588 return sb.ToString();589 }590 public static string AsHeaderStringVerbose_V03_01(string separator, double version, BatchOptions options)591 {592 StringBuilder sb = new StringBuilder();593 sb.Append("Latitude").Append(separator); //3594 sb.Append("Longitude").Append(separator); //4595 sb.Append("NAACCRGISCoordinateQualityCode").Append(separator); //5596 sb.Append("NAACCRGISCoordinateQualityName").Append(separator); //6597 sb.Append("MatchScore").Append(separator); //7598 sb.Append("MatchType").Append(separator); //8599 sb.Append("FeatureMatchingGeographyType").Append(separator); //9600 sb.Append("RegionSize").Append(separator); //10...
VistaUserDao.cs
Source:VistaUserDao.cs
...139 if (response == null || response.Length == 0)140 {141 return null;142 }143 string[] rex = StringUtils.split(response[0], StringUtils.CRLF);144 rex = StringUtils.trimArray(rex);145 if (rex.Length != 1)146 {147 throw new Exception("Multiple records returned");148 }149 string[] flds = StringUtils.split(rex[0], StringUtils.CARET);150 User result = new User();151 result.Uid = flds[0];152 result.Name = new PersonName(flds[1]);153 result.Phone = flds[2];154 result.VoicePager = flds[3];155 if (flds[4] != "")156 {157 result.VoicePager += (flds[3] != "" ? "/" : "") + flds[4];158 }159 result.Office = flds[5];160 if (flds[6] != "")161 {162 result.Title = getUserTitle(flds[6]);163 }164 result.SSN = new SocSecNum(flds[7]);165 if (flds[8] != "")166 {167 result.Service = getUserService(flds[8]);168 }169 return result;170 }171 //-----------------------------------------------------------------------------------------172 internal DdrLister buildUserLookupQueryByDuz(string duz)173 {174 DdrLister query = new DdrLister(cxn);175 query.File = "200";176 // E flag note177 query.Fields = "@;.01;.132;.137;.141;3;4;5;7;8E;9;13;20.2;20.3;29;29E;53.5;53.5E;53.6;201;201E";178 query.Flags = "IP";179 query.Max = "1";180 query.From = VistaUtils.adjustForNumericSearch(duz);181 query.Part = duz;182 query.Xref = "#";183 return query;184 }185 internal DdrLister buildUserLookupQueryBySsn(string ssn)186 {187 DdrLister query = new DdrLister(cxn);188 query.File = "200";189 // E flag note190 query.Fields = "@;.01;.132;.137;.141;3;4;5;7;8E;9;13;20.2;20.3;29;29E;53.5;53.5E;53.6;201;201E";191 query.Flags = "IP";192 query.Max = "1";193 query.From = VistaUtils.adjustForNumericSearch(ssn);194 query.Part = ssn;195 query.Xref = "SSN";196 return query;197 }198 internal User toUser(string[] response)199 {200 if (response == null || response.Length == 0)201 {202 return null;203 }204 string[] flds = StringUtils.split(response[0], StringUtils.CARET);205 User result = new User();206 result.Uid = flds[0];207 result.Name = new PersonName(flds[1]);208 result.Phone = flds[2];209 result.Office = flds[4];210 //flds[5] is FM access211 result.Gender = flds[6];212 result.DOB = VistaTimestamp.toUtcString(flds[7]);213 //flds[8] is disuser214 result.Title = flds[9];215 result.SSN = new SocSecNum(flds[10]);216 //flds[11] is nickname217 result.SigText = flds[12] + "\r\n" + flds[13];218 if (flds[14] != "" || flds[15] != "")219 {220 result.Service = new Service();221 result.Service.Id = flds[14];222 result.Service.Name = flds[15];223 }224 //flds[16] is Provider Class IEN225 result.UserClass = flds[17];226 result.PrimaryPermission = new MenuOption(flds[19], flds[20]);227 return result;228 }229 internal MdoQuery buildProviderLookup(string target)230 {231 target = VistaUtils.adjustForNameSearch(target);232 VistaQuery vq = new VistaQuery("ORWU NEWPERS");233 vq.addParameter(vq.LITERAL, target.ToUpper());234 vq.addParameter(vq.LITERAL, "1");235 //vq.addParameter(vq.LITERAL, "PROVIDER"); // see ticket http://trac.medora.va.gov/web/ticket/3091236 return vq;237 }238 internal User[] toUsers(String rtn)239 {240 ArrayList lst = new ArrayList();241 String[] entries = StringUtils.split(rtn, StringUtils.CRLF);242 for (int i = 0; i < entries.Length; i++)243 {244 if (entries[i] == "")245 {246 continue;247 }248 String[] flds = StringUtils.split(entries[i], StringUtils.CARET);249 if (StringUtils.isNumeric(flds[0]))250 {251 User user = new User();252 user.Uid = flds[0];253 user.setName(flds[1]);254 if (flds.Length > 2 && !String.IsNullOrEmpty(flds[2]))255 {256 user.Title = flds[2];257 }258 lst.Add(user);259 }260 }261 return (User[])lst.ToArray(typeof(User));262 }263 internal DdrLister buildUserLookupByNameQuery(string target, string maxRex)264 {265 DdrLister query = new DdrLister(cxn);266 query.File = "200";267 // E flag note268 query.Fields = "@;.01;.132;.137;.141;3;4;5;7;8E;9;13;20.2;20.3;29;29E;53.5;53.5E;53.6;201;201E";269 query.Flags = "IP";270 query.Max = maxRex;271 target = target.ToUpper();272 query.From = VistaUtils.adjustForNameSearch(target);273 query.Part = target;274 query.Xref = "B";275 return query;276 }277 internal User[] toUsers(string[] response)278 {279 if (response == null || response.Length == 0)280 {281 return null;282 }283 response = StringUtils.trimArray(response);284 User[] result = new User[response.Length];285 for (int i = 0; i < response.Length; i++)286 {287 string[] flds = StringUtils.split(response[i], StringUtils.CARET);288 result[i] = new User();289 result[i].Uid = flds[0];290 result[i].Name = new PersonName(flds[1]);291 result[i].Phone = flds[2];292 result[i].Office = flds[4];293 //flds[5] is FM access294 result[i].Gender = flds[6];295 result[i].DOB = VistaTimestamp.toUtcString(flds[7]);296 //flds[8] is disuser297 result[i].Title = flds[9];298 result[i].SSN = new SocSecNum(flds[10]);299 //flds[11] is nickname300 result[i].SigText = flds[12] + "\r\n" + flds[13];301 //flds[14] is service IEN302 if (flds[15] != "")303 {304 result[i].Service = new Service();305 result[i].Service.Name = flds[15];306 }307 //flds[16] is Provider Class IEN308 result[i].UserClass = flds[17];309 result[i].PrimaryPermission = new MenuOption(flds[19], flds[20]);310 }311 return result;312 }313 //=========================================================================================314 // User Properties315 //=========================================================================================316 public string getUserId(KeyValuePair<string, string> param)317 {318 if (param.Key == "SSN")319 {320 return getUserIdBySsn(param.Value);321 }322 throw new ArgumentException("Only SSN lookups are currently implemented");323 }324 internal string getUserIdBySsn(string ssn)325 {326 //if (StringUtils.isEmpty(ssn) || !VistaSocSecNum.isValid(ssn))327 //{328 // throw new ArgumentException("Invalid SSN");329 //}330 string arg = "$O(^VA(200,\"SSN\",\"" + ssn + "\",0))";331 string response = VistaUtils.getVariableValue(cxn, arg);332 return VistaUtils.errMsgOrIen(response);333 }334 public string getUserTitle(string ien)335 {336 if (StringUtils.isEmpty(ien))337 {338 throw new ArgumentException("Invalid IEN");339 }340 string arg = "$P($G(^DIC(3.1," + ien + ",0)),U,1)";341 return VistaUtils.getVariableValue(cxn, arg);342 }343 public string getProviderClass(string ien)344 {345 if (StringUtils.isEmpty(ien))346 {347 throw new ArgumentException("Invalid IEN");348 }349 string arg = "$P($G(^DIC(7," + ien + ",0)),U,1)";350 return VistaUtils.getVariableValue(cxn, arg);351 }352 public Service getUserService(string ien)353 {354 if (StringUtils.isEmpty(ien))355 {356 throw new ArgumentException("Invalid IEN");357 }358 string arg = "$G(^DIC(49," + ien + ",0))";359 string response = VistaUtils.getVariableValue(cxn, arg);360 if (response == "")361 {362 return null;363 }364 string[] flds = StringUtils.split(response, StringUtils.CARET);365 Service result = new Service();366 result.Id = ien;367 if (flds.Length > 0)368 {369 result.Name = flds[0];370 }371 if (flds.Length > 1)372 {373 result.Abbreviation = flds[1];374 }375 if (flds.Length > 2)376 {377 if (flds[2] != "")378 {379 result.Chief = new User();380 result.Chief.Uid = flds[2];381 }382 }383 if (flds.Length > 3)384 {385 if (flds[3] != "" && flds[3] != ien)386 {387 result.ParentService = new Service();388 result.ParentService.Id = flds[3];389 }390 }391 // Don't care about flds 4 and 5392 if (flds.Length > 6)393 {394 result.Location = flds[6];395 }396 if (flds.Length > 7)397 {398 result.MailSymbol = flds[7];399 }400 if (flds.Length > 8)401 {402 if (flds[8] == "C")403 {404 result.Type = "PATIENT CARE";405 }406 else if (flds[8] == "A")407 {408 result.Type = "ADMINISTRATIVE";409 }410 else411 {412 result.Type = "";413 }414 }415 return result;416 }417 public void setLoginSiteProperties(User user)418 {419 if (user == null || StringUtils.isEmpty(user.Uid))420 {421 throw new ArgumentException("No user ID for site");422 }423 VistaQuery vq = new VistaQuery("ORWU USERINFO");424 string rtn = (String)cxn.query(vq);425 if (rtn == null)426 {427 throw new DataException("Unable to get user info");428 }429 string[] parts = StringUtils.split(rtn, StringUtils.CARET);430 user.Uid = parts[0];431 user.setName(parts[1]);432 user.OrderRole = parts[5];433 vq = new VistaQuery("XWB GET VARIABLE VALUE");434 string arg = "@\"^VA(200," + user.Uid + ",1)\"";435 vq.addParameter(vq.REFERENCE, arg);436 rtn = (string)cxn.query(vq);437 if (rtn == "")438 {439 throw new DataException("Unable to get user SSN");440 }441 parts = StringUtils.split(rtn, StringUtils.CARET);442 user.SSN = new SocSecNum(parts[8]);443 }444 public void setUserInfoAtLogin(User user)445 {446 VistaQuery vq = new VistaQuery("XUS GET USER INFO");447 string response = (string)cxn.query(vq);448 toUserFromLogin(response, user);449 }450 public User getUserInfo(string duz)451 {452 User result = new User();453 result.Uid = duz;454 result.LogonSiteId = cxn.DataSource.SiteId;455 setUserInfo(result);456 return result;457 }458 public void setUserInfo(User user)459 {460 string DUZ = user.Uid;461 string arg = "$P($G(^VA(200," + DUZ + ",0)),\"^\",1)";462 arg += "_\"^\"_" + "$P($G(^VA(200," + DUZ + ",1)),\"^\",9)";463 arg += "_\"^\"_" + "$P($G(^VA(200," + DUZ + ",.14)),\"^\",1)";464 arg += "_\"^\"_" + "$P($G(^VA(200," + DUZ + ",.13)),\"^\",2)";465 arg += "_\"^\"_" + "$P($G(^VA(200," + DUZ + ",.13)),\"^\",8)";466 arg += "_\"^\"_" + "$P($G(^ECC(730,$S($D(^VA(200," + DUZ + ",\"QAR\")):^VA(200," + DUZ + ",\"QAR\"),1:-1),0)),\"^\",1)";467 arg += "_\"^\"_" + "$G(^DIC(3.1,$S($P(^VA(200," + DUZ + ",0),\"^\",9):$P(^VA(200," + DUZ + ",0),\"^\",9),1:-1),0))";468 string response = "";469 try470 {471 response = VistaUtils.getVariableValue(cxn, arg);472 }473 catch (Exception e)474 {475 if (e.Message.Contains("M ERROR"))476 {477 throw new ArgumentException("No such DUZ");478 }479 else480 {481 throw e;482 }483 }484 setUserProperties(user, response);485 }486 public bool isVisitorAccount(string duz)487 {488 string arg = "$G(^VA(200," + duz + ",0))";489 string response = VistaUtils.getVariableValue(cxn, arg);490 string[] flds = StringUtils.split(response, StringUtils.CARET);491 if (flds.Length == 1 || flds[2] == "")492 {493 return true;494 }495 return false;496 }497 public void addVisitorInfo(AbstractCredentials credentials)498 {499 string DUZ = credentials.LocalUid;500 string arg = "$P($G(^VA(200," + DUZ + ",0)),\"^\",1)"; //NAME501 arg += "_\"^\"_" + "$P($G(^VA(200," + DUZ + ",1)),\"^\",9)";502 arg += "_\"^\"_" + "$P($G(^VA(200," + DUZ + ",.13)),\"^\",2)"; //OFFICE PHONE503 string response = "";504 try505 {506 response = VistaUtils.getVariableValue(cxn, arg);507 }508 catch (Exception e)509 {510 if (e.Message.Contains("M ERROR"))511 {512 throw new ArgumentException("No such DUZ");513 }514 else515 {516 throw e;517 }518 }519 if (response == "")520 {521 return;522 }523 string[] flds = StringUtils.split(response, StringUtils.CARET);524 credentials.FederatedUid = flds[1];525 credentials.SubjectName = flds[0];526 credentials.SubjectPhone = flds[2];527 credentials.AuthenticationSource.SiteId.Id = cxn.DataSource.SiteId.Id;528 credentials.AuthenticationSource.SiteId.Name = cxn.DataSource.SiteId.Name;529 }530 //-----------------------------------------------------------------------------------------531 //internal string decodeProviderType(string value)532 //{533 // if (value == "1")534 // {535 // return "FULL TIME";536 // }537 // if (value == "2")538 // {539 // return "PART TIME";540 // }541 // if (value == "3")542 // {543 // return "C & A";544 // }545 // if (value == "4")546 // {547 // return "FEE BASIS";548 // }549 // if (value == "5")550 // {551 // return "HOUSE STAFF";552 // }553 // throw new ArgumentException("Invalid value");554 //}555 internal void toUserFromLogin(string response, User user)556 {557 if (response == "")558 {559 return;560 }561 string[] flds = StringUtils.split(response, StringUtils.CRLF);562 user.Uid = flds[0];563 user.Name = new PersonName(flds[1]);564 string[] subflds = StringUtils.split(flds[3], StringUtils.CARET);565 user.LogonSiteId = new SiteId(subflds[2], subflds[1]);566 user.Title = flds[4];567 if (flds[5] != "")568 {569 user.Service = new Service();570 user.Service.Name = flds[5];571 }572 }573 internal void setUserProperties(User user, string response)574 {575 if (response == "")576 {577 return;578 }579 string[] flds = StringUtils.split(response, StringUtils.CARET);580 user.Name = new PersonName(flds[0]);581 user.SSN = new SocSecNum(flds[1]);582 user.Office = flds[2];583 user.Phone = flds[3];584 user.VoicePager = flds[4];585 if (flds[5] != "")586 {587 user.Service = new Service();588 user.Service.Name = flds[5];589 }590 user.Title = flds[6];591 }592 internal bool hasVisitorAlias(string duz)593 {594 DdrLister query = buildHasVisitorAliasQuery(duz);595 string[] response = query.execute();596 for (int i = 0; i < response.Length; i++)597 {598 string[] flds = StringUtils.split(response[i], StringUtils.CARET);599 if (flds[1] == "VISITOR")600 {601 return true;602 }603 }604 return false;605 }606 internal DdrLister buildHasVisitorAliasQuery(string duz)607 {608 DdrLister query = new DdrLister(cxn);609 query.File = "200.04";610 query.Iens = "," + duz + ",";611 query.Fields = ".01";612 query.Flags = "IP";613 query.Xref = "#";614 return query;615 }616 // This is testing for presence of A/V codes. It appears that the VERIFY CODE does not617 // get populated in Vista, but that the ACCESS CODE field holds both codes. Therefore,618 // we test only 1 field.619 internal bool isTrueCapriUser(Dictionary<string, SecurityKey> keys)620 {621 if (keys == null)622 {623 return false;624 }625 foreach (string k in keys.Keys)626 {627 if (keys[k].Name.StartsWith("DVBA"))628 {629 return true;630 }631 }632 return false;633 }634 //=========================================================================================635 // Permissions636 //=========================================================================================637 public void setContext(string context)638 {639 MdoQuery request = buildSetContextRequest(context);640 string response = (string)cxn.query(request);641 if (response != "1")642 {643 throw getException(response);644 }645 }646 public void validateLocalAccount(string duz)647 {648 string arg = "$G(^VA(200," + duz + ",0))";649 string response = VistaUtils.getVariableValue(cxn, arg);650 if (response == "")651 {652 throw new UnauthorizedAccessException("No such user");653 }654 string[] flds = StringUtils.split(response, StringUtils.CARET);655 if (flds.Length < 2 || flds[2] == "")656 {657 throw new UnauthorizedAccessException("User has no access code at this site");658 }659 if (flds.Length > 6 && flds[6] != "")660 {661 throw new UnauthorizedAccessException("Account has been disusered");662 }663 if (flds.Length > 10 && flds[10] != "")664 {665 throw new UnauthorizedAccessException("Account has been deactivated");666 }667 }668 public bool isValidEsig(string esig)669 {670 MdoQuery request = buildIsValidEsigRequest(esig);671 string response = (string)cxn.query(request);672 return (response == "1");673 }674 public string setNewPassword(string oldVerifyCode, string newVerifyCode)675 {676 VistaQuery vq = new VistaQuery("XUS CVC");677 string oldEncodedVerifyCode = VistaQuery.Parameter.encrypt(oldVerifyCode.ToUpper());678 string newEncodedVerifyCode = VistaQuery.Parameter.encrypt(newVerifyCode.ToUpper());679 vq.addParameter(vq.LITERAL, oldEncodedVerifyCode + '^' + newEncodedVerifyCode + '^' + newEncodedVerifyCode);680 string rtn = (string)cxn.query(vq);681 if (rtn.StartsWith("0"))682 {683 return "OK";684 }685 else686 {687 return rtn.Substring(1);688 }689 }690 //-----------------------------------------------------------------------------------------691 internal MdoQuery buildSetContextRequest(string context)692 {693 VistaQuery vq = new VistaQuery("XWB CREATE CONTEXT");694 vq.addEncryptedParameter(vq.LITERAL, context);695 return vq;696 }697 internal Exception getException(string result)698 {699 if (result.IndexOf("The context") != -1 &&700 result.IndexOf("does not exist on server") != -1)701 {702 return new PermissionNotFoundException(result);703 }704 if (result.IndexOf("User") != -1 &&705 result.IndexOf("does not have access to option") != -1)706 {707 return new UnauthorizedAccessException(result);708 }709 if (result.IndexOf("Option locked") != -1 &&710 result.IndexOf("does not have access to option") != -1)711 {712 return new PermissionLockedException(result);713 }714 return new Exception(result);715 }716 //DP 5/23/2011 Added guard clause to this query builder methos so it will not save a (one time valid) 717 //encrypted string in the mock connection file.718 internal MdoQuery buildIsValidEsigRequest(string esig)719 {720 VistaQuery vq = new VistaQuery("ORWU VALIDSIG");721 if (cxn.GetType().Name != "MockConnection")722 {723 vq.addEncryptedParameter(vq.LITERAL, esig);724 }725 else726 {727 vq.addParameter(vq.LITERAL, esig);728 }729 //vq.addParameter(vq.LITERAL, esig);730 return vq;731 }732 //=========================================================================================733 // Permissions734 //=========================================================================================735 public AbstractPermission addPermission(string duz, AbstractPermission p)736 {737 if (p.Type == PermissionType.MenuOption)738 {739 p.RecordId = addMenuOption(duz, p);740 return p;741 }742 if (p.Type == PermissionType.DelegatedOption)743 {744 p.RecordId = addDelegatedOption(duz, p);745 return p;746 }747 if (p.Type == PermissionType.SecurityKey)748 {749 return addSecurityKey(duz, p);750 }751 throw new ArgumentException("Invalide permission type");752 }753 public void removePermission(string duz, AbstractPermission p)754 {755 if (p.Type == PermissionType.MenuOption)756 {757 removeMenuOption(duz, p);758 }759 if (p.Type == PermissionType.DelegatedOption)760 {761 removeDelegatedOption(duz, p);762 }763 if (p.Type == PermissionType.SecurityKey)764 {765 removeSecurityKey(duz, p);766 }767 throw new ArgumentException("Invalid permission type");768 }769 public bool hasPermission(string duz, AbstractPermission p)770 {771 if (p.Type == PermissionType.MenuOption)772 {773 return hasMenuOption(duz, p);774 }775 if (p.Type == PermissionType.DelegatedOption)776 {777 return hasDelegatedOption(duz, p);778 }779 if (p.Type == PermissionType.SecurityKey)780 {781 return hasSecurityKey(duz, p);782 }783 throw new ArgumentException("Invalid permission type");784 }785 public Dictionary<string, AbstractPermission> getPermissions(PermissionType type, string duz)786 {787 if (StringUtils.isEmpty(duz))788 {789 throw new ArgumentNullException("Missing DUZ");790 }791 try792 {793 if (type == PermissionType.MenuOption)794 {795 return getMenuOptions(duz);796 }797 if (type == PermissionType.DelegatedOption)798 {799 return getDelegatedOptions(duz);800 }801 if (type == PermissionType.SecurityKey)802 {803 return getSecurityKeys(duz);804 }805 throw new ArgumentException("Invalid type");806 }807 catch (ConnectionException ce)808 {809 throw new ArgumentException(ce.Message);810 }811 }812 //=========================================================================================813 // Permissions: options814 //=========================================================================================815 internal string addOption(string file, string context, string duz)816 {817 //Did we get a numeric DUZ?818 if (!StringUtils.isNumeric(duz))819 {820 throw new ArgumentException("Non-numeric user ID");821 }822 //Now make sure site has the requested option. Otherwise a record will be written with a bad pointer to823 //file 19.824 string optionIen = getOptionIen(context);825 if (optionIen == "")826 {827 throw new ArgumentException("No such context");828 }829 DdrFiler query = buildAddOptionQuery(file, optionIen, duz);830 string response = query.execute();831 return toAddOptionResult(response);832 }833 internal DdrFiler buildAddOptionQuery(string file, string optionIen, string duz)834 {835 DdrFiler query = new DdrFiler(cxn);836 query.Operation = "ADD";837 query.Args = new string[]838 {839 file + "^.01^+1," + duz + ",^" + optionIen840 };841 return query;842 }843 internal string toAddOptionResult(string response)844 {845 if (response == "")846 {847 return "";848 }849 string[] lines = StringUtils.split(response, StringUtils.CRLF);850 lines = StringUtils.trimArray(lines);851 if (lines[0] == "[Data]" && lines.Length == 2)852 {853 return parseOptionNumber(response);854 }855 throw new DataException("addOption error: " + lines[lines.Length - 2]);856 }857 internal string parseOptionNumber(String rtn)858 {859 string[] lines = StringUtils.split(rtn, StringUtils.CRLF);860 if (lines[0] != "[Data]")861 {862 throw new UnexpectedDataException("Invalid return format (" + rtn + ")");863 }864 if (lines[1].StartsWith("[BEGIN_diERRORS]"))865 {866 throw new DataException(rtn.Substring(8));867 }868 if (lines.Length == 1)869 {870 throw new DataException("No option number data");871 }872 int p = lines[1].IndexOf(",^");873 string optNum = lines[1].Substring(p + 2);874 if (!StringUtils.isNumeric(optNum))875 {876 throw new UnexpectedDataException("Non-numeric option number");877 }878 return optNum;879 }880 internal string removeOption(string file, string optNum, string duz)881 {882 DdrFiler query = buildRemoveOptionQuery(file, optNum, duz);883 string response = query.execute();884 return toRemoveOptionResult(response);885 }886 internal DdrFiler buildRemoveOptionQuery(string file, string optNum, string duz)887 {888 DdrFiler query = new DdrFiler(cxn);889 query.Operation = "EDIT";890 query.Args = new string[]891 {892 file + "^.01^" + optNum + "," + duz + ",^@"893 };894 return query;895 }896 internal string toRemoveOptionResult(string response)897 {898 if (response == "")899 {900 return "";901 }902 string[] lines = StringUtils.split(response, StringUtils.CRLF);903 lines = StringUtils.trimArray(lines);904 if (lines[0] == "[Data]" && lines.Length == 1)905 {906 return "OK";907 }908 if (lines[1] != VistaConstants.BEGIN_ERRS && lines[lines.Length - 1] != VistaConstants.END_ERRS)909 {910 return "Unexpected return message: " + response;911 }912 return "removeOption error: " + lines[lines.Length - 2];913 }914 internal Dictionary<string, AbstractPermission> getOptions(string file, string uid)915 {916 if (StringUtils.isEmpty(file) || StringUtils.isEmpty(uid))917 {918 throw new ArgumentNullException("Missing arguments");919 }920 DdrLister query = buildGetOptionsQuery(file, uid);921 string[] response = query.execute();922 return toOptions(response);923 }924 internal DdrLister buildGetOptionsQuery(string file, string uid)925 {926 DdrLister query = new DdrLister(cxn);927 query.File = file;928 query.Iens = "," + uid + ",";929 // No worry about E flag since Screen arg rules out zombies930 query.Fields = ".01;.01E";931 query.Flags = "IP";932 query.Screen = "I $D(^DIC(19,$P(^(0),U,1),0))'=0";933 return query;934 }935 internal Dictionary<string, AbstractPermission> toOptions(string[] response)936 {937 if (response == null || response.Length == 0)938 {939 return null;940 }941 Dictionary<string, AbstractPermission> result = new Dictionary<string, AbstractPermission>(response.Length);942 for (int i = 0; i < response.Length; i++)943 {944 string[] flds = StringUtils.split(response[i], StringUtils.CARET);945 if (!result.ContainsKey(flds[0]))946 {947 MenuOption opt = toOption(response[i]);948 //addOptionFields(opt);949 result.Add(flds[0], opt);950 }951 }952 return result;953 }954 internal MenuOption toOption(string response)955 {956 if (StringUtils.isEmpty(response))957 {958 return null;959 }960 string[] flds = StringUtils.split(response, StringUtils.CARET);961 return new MenuOption(flds[1], flds[2], flds[0]);962 }963 internal void addOptionFields(VistaOption opt)964 {965 string arg = "$P($G(^DIC(19," + opt.PermissionId + ",0)),U,1)_U_" +966 "$P(^(0),U,2)_U_" +967 "$P(^(0),U,4)_U_" +968 "$P(^(0),U,6)_U_" +969 "$P($G(^DIC(19," + opt.PermissionId + ",3)),U,1)";970 string response = VistaUtils.getVariableValue(cxn, arg);971 string[] flds = StringUtils.split(response, StringUtils.CARET);972 opt.Name = flds[0];973 opt.DisplayName = flds[1];974 opt.OptionType = flds[2];975 if (flds[3] != "")976 {977 opt.Key = new SecurityKey(flds[3], "");978 }979 if (flds[4] != "")980 {981 opt.ReverseKey = new SecurityKey(flds[4], "");982 }983 return;984 }985 internal string getOptionIen(string optionName)986 {987 if (StringUtils.isEmpty(optionName))988 {989 throw new ArgumentNullException("Missing option name");990 }991 VistaQuery vq = new VistaQuery("XWB GET VARIABLE VALUE");992 string arg = "$O(^DIC(19,\"B\",\"" + optionName + "\",0))";993 vq.addParameter(vq.REFERENCE, arg);994 string response = (string)cxn.query(vq);995 return VistaUtils.errMsgOrIen(response);996 }997 internal bool hasOption(string duz, string optionName, string fieldNum)998 {999 if (StringUtils.isEmpty(duz) || StringUtils.isEmpty(optionName))1000 {1001 throw new ArgumentException("Invalid args");1002 }1003 string optIen = getOptionIen(optionName);1004 string arg = "$D(^VA(200," + duz + "," + fieldNum + ",\"B\"," + optIen + "))";1005 string result = VistaUtils.getVariableValue(cxn, arg);1006 return (result != "0");1007 }1008 //=========================================================================================1009 // Permissions: menu options1010 //=========================================================================================1011 internal string addMenuOption(string duz, AbstractPermission p)1012 {1013 return addOption(VistaConstants.MENU_OPTIONS_FILE, p.Name, duz);1014 }1015 internal void removeMenuOption(string duz, AbstractPermission p)1016 {1017 removeOption(VistaConstants.MENU_OPTIONS_FILE, p.RecordId, duz);1018 }1019 internal Dictionary<string, AbstractPermission> getMenuOptions(string duz)1020 {1021 Dictionary<string, AbstractPermission> result = new Dictionary<string, AbstractPermission>();1022 AbstractPermission primaryOpt = getPrimaryMenuOption(duz);1023 if (primaryOpt != null)1024 {1025 result.Add(primaryOpt.Name, primaryOpt);1026 }1027 Dictionary<string, AbstractPermission> secondaryOpts = getOptions(VistaConstants.MENU_OPTIONS_FILE, duz);1028 if (secondaryOpts != null)1029 {1030 foreach (KeyValuePair<string, AbstractPermission> kvp in secondaryOpts)1031 {1032 result.Add(kvp.Key, kvp.Value);1033 }1034 }1035 return result;1036 }1037 internal AbstractPermission getPrimaryMenuOption(string duz)1038 {1039 string arg = "$P($G(^VA(200," + duz + ",201)),U,1)";1040 string optionIen = VistaUtils.getVariableValue(cxn, arg);1041 if (optionIen == "")1042 {1043 return null;1044 }1045 arg = "$P($G(^DIC(19," + optionIen + ",0)),U,1)";1046 string optionName = VistaUtils.getVariableValue(cxn, arg);1047 MenuOption result = new MenuOption();1048 result.PermissionId = optionIen;1049 result.Name = optionName;1050 result.IsPrimary = true;1051 return result;1052 }1053 internal bool hasMenuOption(string duz, AbstractPermission p)1054 {1055 return hasOption(duz, p.Name, VistaConstants.MENU_OPTIONS);1056 }1057 //=========================================================================================1058 // Permissions: delegated options1059 //=========================================================================================1060 internal string addDelegatedOption(string duz, AbstractPermission p)1061 {1062 return addOption(VistaConstants.DELEGATED_OPTIONS_FILE, p.Name, duz);1063 }1064 public void removeDelegatedOption(string duz, AbstractPermission p)1065 {1066 removeOption(VistaConstants.DELEGATED_OPTIONS_FILE, p.RecordId, duz);1067 }1068 internal Dictionary<string, AbstractPermission> getDelegatedOptions(string duz)1069 {1070 return getOptions(VistaConstants.DELEGATED_OPTIONS_FILE, duz);1071 }1072 internal bool hasDelegatedOption(string duz, AbstractPermission p)1073 {1074 return hasOption(duz, p.Name, VistaConstants.DELEGATED_OPTIONS_FILE);1075 }1076 //=========================================================================================1077 // Permissions: security keys1078 //=========================================================================================1079 public AbstractPermission addSecurityKey(string duz, AbstractPermission p)1080 {1081 // No empty args1082 if (p == null || String.IsNullOrEmpty(p.Name) || String.IsNullOrEmpty(duz))1083 {1084 throw new ArgumentNullException("Missing arguments");1085 }1086 // No bogus security keys1087 p.PermissionId = getSecurityKeyIen(p.Name);1088 if (!StringUtils.isNumeric(p.PermissionId))1089 {1090 throw new ArgumentException("No such security key");1091 }1092 // No bogus users1093 if (!isUser(duz))1094 {1095 throw new ArgumentException("No such user");1096 }1097 // Make sure user does not already have this key1098 if (hasSecurityKey(duz, p))1099 {1100 throw new ArgumentException("User already has key");1101 }1102 p.RecordId = addSecurityKeyByName(p.Name, duz);1103 return p;1104 }1105 public void removeSecurityKey(string duz, AbstractPermission p)1106 {1107 // No empty args1108 if (p == null || String.IsNullOrEmpty(p.Name) || String.IsNullOrEmpty(duz))1109 {1110 throw new ArgumentNullException("Missing arguments");1111 }1112 // No bogus security keys1113 p.PermissionId = getSecurityKeyIen(p.Name);1114 if (!StringUtils.isNumeric(p.PermissionId))1115 {1116 throw new ArgumentException("No such security key");1117 }1118 // No bogus users1119 if (!isUser(duz))1120 {1121 throw new ArgumentException("No such user");1122 }1123 // Make sure user has this key1124 if (!hasSecurityKey(duz, p))1125 {1126 throw new ArgumentException("User does not have key");1127 }1128 // Do it1129 DdrFiler query = buildRemoveSecurityKeyByIenQuery(p.PermissionId, duz);1130 string response = query.execute();1131 if (response == "")1132 {1133 throw new UnexpectedDataException("Empty response");1134 }1135 if (response == "[Data]\r\n")1136 {1137 return;1138 }1139 string[] lines = StringUtils.split(response, StringUtils.CRLF);1140 if (lines[0] != "[Data]")1141 {1142 throw new UnexpectedDataException("Unexpected response: " + response);1143 }1144 if (lines.Length > 1)1145 {1146 if (lines[1] != "[BEGIN_diERRORS]" || lines.Length < 5)1147 {1148 throw new UnexpectedDataException("Unexpected response: " + response);1149 }1150 throw new ArgumentException(lines[4]);1151 }1152 }1153 public string getSecurityKeyForContext(string context)1154 {1155 if (StringUtils.isEmpty(context))1156 {1157 throw new ArgumentNullException("Missing context");1158 }1159 string contextIen = getOptionIen(context);1160 VistaQuery vq = new VistaQuery("XWB GET VARIABLE VALUE");1161 string arg = "$G(^DIC(19," + contextIen + ",0))";1162 vq.addParameter(vq.REFERENCE, arg);1163 string response = (string)cxn.query(vq);1164 return extractSecurityKey(response);1165 }1166 public string addSecurityKeyForContext(string duz, string context)1167 {1168 return null;1169 //if (StringUtils.isEmpty(duz) || StringUtils.isEmpty(context))1170 //{1171 // throw new ArgumentNullException("Missing arguments");1172 //}1173 //string securityKey = getSecurityKeyForContext(context);1174 //if (securityKey == "")1175 //{1176 // throw new ArgumentException("No security key for context " + context);1177 //}1178 //return addSecurityKey(duz, securityKey);1179 }1180 internal Dictionary<string, AbstractPermission> getSecurityKeys(string duz)1181 {1182 DdrLister query = buildGetSecurityKeysQuery(duz);1183 string[] response = query.execute();1184 return toUserSecurityKeys(response);1185 }1186 internal string getSecurityKeyIen(string securityKeyName)1187 {1188 string arg = "$O(^DIC(19.1,\"B\",\"" + securityKeyName + "\",0))";1189 return VistaUtils.getVariableValue(cxn, arg);1190 }1191 internal string addSecurityKeyByName(string securityKeyName, string duz)1192 {1193 if (StringUtils.isEmpty(securityKeyName) || StringUtils.isEmpty(duz))1194 {1195 throw new ArgumentNullException("Missing arguments");1196 }1197 DdrLister query = buildAddSecurityKeyByNameQuery(securityKeyName, duz);1198 string[] response = query.execute();1199 if (response == null || response.Length == 0)1200 {1201 throw new ArgumentException("Unable to add security key " + securityKeyName + " for user " + duz);1202 }1203 string[] flds = StringUtils.split(response[0], StringUtils.CARET);1204 if (flds[1] != securityKeyName)1205 {1206 throw new DataException("Error adding security key: " + response);1207 }1208 return flds[0];1209 }1210 internal DdrLister buildAddSecurityKeyByNameQuery(string securityKeyName, string duz)1211 {1212 // Can't use DDR FILER because the underlying M function requires 2 arrays and the1213 // broker can only do 1.1214 // Idea is to make a query that is guaranteed to find a record, then use the identifier1215 // argument to add the new record.1216 DdrLister query = new DdrLister(cxn);1217 query.File = "19.1";1218 query.Fields = ".01";1219 query.Flags = "IP";1220 query.From = VistaUtils.adjustForNameSearch(securityKeyName);1221 query.Part = securityKeyName;1222 query.Xref = "B";1223 query.Id = "X \"S XQKUS=" + duz + " S XQKEY=$P(^(0),U,1) S XQKF=0 D ADD^XQKEY(XQKUS,XQKEY,XQKF) D EN^DDIOL(XQKF)\"";1224 return query;1225 }1226 internal string extractSecurityKey(string response)1227 {1228 return StringUtils.piece(response, "^", 6);1229 }1230 internal DdrLister buildGetSecurityKeysQuery(string duz)1231 {1232 DdrLister query = new DdrLister(cxn);1233 query.File = "200.051";1234 query.Iens = "," + duz + ",";1235 query.Fields = ".01;1;2;3";1236 query.Flags = "IP";1237 return query;1238 }1239 internal Dictionary<string, AbstractPermission> toUserSecurityKeys(string[] response)1240 {1241 if (response == null || response.Length == 0)1242 {1243 return null;1244 }1245 StringDictionary securityKeyFile = cxn.SystemFileHandler.getLookupTable(VistaConstants.SECURITY_KEY);1246 Dictionary<string, AbstractPermission> result = new Dictionary<string, AbstractPermission>(response.Length);1247 for (int i = 0; i < response.Length; i++)1248 {1249 string[] flds = StringUtils.split(response[i], StringUtils.CARET);1250 if (securityKeyFile.ContainsKey(flds[1]))1251 {1252 AbstractPermission key = new SecurityKey(flds[1], securityKeyFile[flds[1]], flds[0]);1253 result.Add(key.Name, key);1254 }1255 }1256 return result;1257 }1258 internal DdrFiler buildRemoveSecurityKeyByIenQuery(string securityKeyIen, string duz)1259 {1260 DdrFiler query = new DdrFiler(cxn);1261 query.Operation = "EDIT";1262 query.Args = new string[]1263 {1264 "200.051^.01^" + securityKeyIen + "," + duz + ",^@"1265 };1266 return query;1267 }1268 internal string getSecurityKeyDescriptiveName(string ien)1269 {1270 string arg = "$P($G(^DIC(19.1," + ien + ",0)),U,2)";1271 return VistaUtils.getVariableValue(cxn, arg);1272 }1273 internal bool hasSecurityKey(AbstractPermission p)1274 {1275 return hasSecurityKey(cxn.Uid, p);1276 }1277 internal bool hasSecurityKey(string duz, AbstractPermission p)1278 {1279 MdoQuery request = buildHasSecurityKeyRequest(duz, p.Name);1280 string response = (string)cxn.query(request);1281 return (response == "1");1282 }1283 internal MdoQuery buildHasSecurityKeyRequest(string duz, string key)1284 {1285 VistaQuery vq = new VistaQuery("ORWU NPHASKEY");1286 vq.addParameter(vq.LITERAL, duz);1287 vq.addParameter(vq.LITERAL, key);1288 return vq;1289 }1290 /// <summary>1291 /// Get all the users with a certain option1292 /// Currently this is from the Standing Sentry project and only gets1293 /// users with option AMOJ VL APPTFL. Should be generalized.1294 /// </summary>1295 /// <param name="optionName"></param>1296 /// <returns></returns>1297 public OrderedDictionary getUsersWithOption(string optionName)1298 {1299 MdoQuery request = buildGetUsersWithOptionRequest(optionName);1300 string response = (string)cxn.query(request, new MenuOption("AMOJ VL APPTFL"));1301 return toUsersWithOption(response);1302 }1303 internal MdoQuery buildGetUsersWithOptionRequest(string optionName)1304 {1305 VistaQuery vq = new VistaQuery("AMOJ VL APPTFL GET PROVIDERS");1306 return vq;1307 }1308 internal OrderedDictionary toUsersWithOption(string response)1309 {1310 if (String.IsNullOrEmpty(response))1311 {1312 return null;1313 }1314 string[] lines = StringUtils.split(response, StringUtils.CRLF);1315 OrderedDictionary result = new OrderedDictionary();1316 for (int i = 0; i < lines.Length; i++)1317 {1318 if (String.IsNullOrEmpty(lines[i]))1319 {1320 continue;1321 }1322 string[] flds = StringUtils.split(lines[i], StringUtils.CARET);1323 result.Add(flds[1], flds[0]);1324 }1325 return result;1326 }1327 //public string getAppointmentsForProvider(string duz, int days)1328 //{1329 // string request = buildGetAppointmentsForProviderRequest(duz, days);1330 // string response = (string)cxn.query(request);1331 // return response;1332 //}1333 //internal string buildGetAppointmentsForProviderRequest(string duz, int days)1334 //{1335 // VistaQuery vq = new VistaQuery("AMOJ VL APPTFL PROVIDER APPTS");1336 // vq.addParameter(vq.LITERAL, duz);...
Geocode.cs
Source:Geocode.cs
...227 }228 public override string AsStringVerbose_V03_01(string separator, double version, BatchOptions options)229 {230 StringBuilder sb = new StringBuilder();231 sb.Append("\"" + StringUtils.EscapeChar(Latitude.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //3232 sb.Append("\"" + StringUtils.EscapeChar(Longitude.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //4233 sb.Append("\"" + StringUtils.EscapeChar(NAACCRGISCoordinateQualityCode, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //5234 sb.Append("\"" + StringUtils.EscapeChar(NAACCRGISCoordinateQualityType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //6235 sb.Append("\"" + StringUtils.EscapeChar(MatchScore.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //7236 sb.Append("\"" + StringUtils.EscapeChar(MatchType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //8237 sb.Append("\"" + StringUtils.EscapeChar(FM_GeographyType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //9238 sb.Append("\"" + StringUtils.EscapeChar(RegionSize, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //10239 sb.Append("\"" + StringUtils.EscapeChar(RegionSizeUnits, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //11240 sb.Append("\"" + StringUtils.EscapeChar(InterpolationType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //12241 sb.Append("\"" + StringUtils.EscapeChar(InterpolationSubType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //13242 sb.Append("\"" + StringUtils.EscapeChar(MatchedLocationType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //14243 sb.Append("\"" + StringUtils.EscapeChar(FM_ResultType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //15244 sb.Append("\"" + StringUtils.EscapeChar(FM_ResultCount.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //16245 sb.Append("\"" + StringUtils.EscapeChar(FM_Notes, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //17246 sb.Append("\"" + StringUtils.EscapeChar(FM_TieNotes, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //18247 sb.Append("\"" + StringUtils.EscapeChar(FM_TieStrategy.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //19248 sb.Append("\"" + StringUtils.EscapeChar(FM_SelectionMethod.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //20249 sb.Append("\"" + StringUtils.EscapeChar(FM_SelectionNotes, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21250 if (options == null || options.OutputBookKeepingFieldMappings.Enabled)251 {252 sb.Append("\"" + StringUtils.EscapeChar(Version.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21253 sb.Append("\"" + StringUtils.EscapeChar(QueryStatusCodes.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //2254 sb.Append("\"" + StringUtils.EscapeChar(TimeTaken.TotalMilliseconds.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21255 sb.Append("\"" + StringUtils.EscapeChar(TransactionId, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21256 sb.Append("\"" + StringUtils.EscapeChar(GeocoderName, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21257 sb.Append("\"" + StringUtils.EscapeChar(ErrorMessage, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21258 sb.Append("\"" + StringUtils.EscapeChar(1.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21259 sb.Append("\"" + StringUtils.EscapeChar(RecordId, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21260 }261 if (options == null || options.OutputCensusFieldMappings.Enabled)262 {263 sb.Append("\"" + StringUtils.EscapeChar(CensusYear.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //23264 sb.Append("\"" + StringUtils.EscapeChar(NAACCRCensusTractCertaintyCode, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //24265 sb.Append("\"" + StringUtils.EscapeChar(NAACCRCensusTractCertaintyType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //25266 sb.Append("\"" + StringUtils.EscapeChar(CensusBlock, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //26267 sb.Append("\"" + StringUtils.EscapeChar(CensusBlockGroup, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //27268 sb.Append("\"" + StringUtils.EscapeChar(CensusTract, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //28269 sb.Append("\"" + StringUtils.EscapeChar(CensusCountyFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //29270 sb.Append("\"" + StringUtils.EscapeChar(CensusCbsaFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //30271 sb.Append("\"" + StringUtils.EscapeChar(CensusCbsaMicro, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //31272 sb.Append("\"" + StringUtils.EscapeChar(CensusMcdFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //32273 sb.Append("\"" + StringUtils.EscapeChar(CensusMetDivFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //33274 sb.Append("\"" + StringUtils.EscapeChar(CensusMsaFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //34275 sb.Append("\"" + StringUtils.EscapeChar(CensusPlaceFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //35276 sb.Append("\"" + StringUtils.EscapeChar(CensusStateFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //36277 }278 if (options == null || options.OutputInputAddressFieldMappings.Enabled)279 {280 StreetAddress address = InputAddress;281 sb.Append("\"" + StringUtils.EscapeChar(address.Number, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //37282 sb.Append("\"" + StringUtils.EscapeChar(address.NumberFractional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //38283 sb.Append("\"" + StringUtils.EscapeChar(address.PreDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //39284 sb.Append("\"" + StringUtils.EscapeChar(address.PreQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //40285 sb.Append("\"" + StringUtils.EscapeChar(address.PreType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //41286 sb.Append("\"" + StringUtils.EscapeChar(address.PreArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //42287 sb.Append("\"" + StringUtils.EscapeChar(address.StreetName, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //43288 sb.Append("\"" + StringUtils.EscapeChar(address.PostArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //44289 sb.Append("\"" + StringUtils.EscapeChar(address.PostQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //45290 sb.Append("\"" + StringUtils.EscapeChar(address.Suffix, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //46291 sb.Append("\"" + StringUtils.EscapeChar(address.PostDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //47292 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //48293 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //49294 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //50295 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //51296 sb.Append("\"" + StringUtils.EscapeChar(address.City, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //52297 sb.Append("\"" + StringUtils.EscapeChar(address.ConsolidatedCity, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //53298 sb.Append("\"" + StringUtils.EscapeChar(address.MinorCivilDivision, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //54299 sb.Append("\"" + StringUtils.EscapeChar(address.CountySubregion, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //55300 sb.Append("\"" + StringUtils.EscapeChar(address.County, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //56301 sb.Append("\"" + StringUtils.EscapeChar(address.State, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //57302 sb.Append("\"" + StringUtils.EscapeChar(address.ZIP, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //58303 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus1, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //59304 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus2, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //60305 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus3, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //61306 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus4, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //62307 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus5, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //63308 }309 if (options == null || options.OutputMatchedAddressFieldMappings.Enabled)310 {311 StreetAddress address = MatchedAddress;312 sb.Append("\"" + StringUtils.EscapeChar(address.Number, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //37313 sb.Append("\"" + StringUtils.EscapeChar(address.NumberFractional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //38314 sb.Append("\"" + StringUtils.EscapeChar(address.PreDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //39315 sb.Append("\"" + StringUtils.EscapeChar(address.PreQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //40316 sb.Append("\"" + StringUtils.EscapeChar(address.PreType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //41317 sb.Append("\"" + StringUtils.EscapeChar(address.PreArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //42318 sb.Append("\"" + StringUtils.EscapeChar(address.StreetName, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //43319 sb.Append("\"" + StringUtils.EscapeChar(address.PostArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //44320 sb.Append("\"" + StringUtils.EscapeChar(address.PostQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //45321 sb.Append("\"" + StringUtils.EscapeChar(address.Suffix, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //46322 sb.Append("\"" + StringUtils.EscapeChar(address.PostDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //47323 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //48324 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //49325 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //50326 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //51327 sb.Append("\"" + StringUtils.EscapeChar(address.City, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //52328 sb.Append("\"" + StringUtils.EscapeChar(address.ConsolidatedCity, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //53329 sb.Append("\"" + StringUtils.EscapeChar(address.MinorCivilDivision, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //54330 sb.Append("\"" + StringUtils.EscapeChar(address.CountySubregion, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //55331 sb.Append("\"" + StringUtils.EscapeChar(address.County, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //56332 sb.Append("\"" + StringUtils.EscapeChar(address.State, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //57333 sb.Append("\"" + StringUtils.EscapeChar(address.ZIP, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //58334 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus1, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //59335 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus2, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //60336 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus3, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //61337 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus4, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //62338 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus5, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //63339 }340 if (options == null || options.OutputParsedAddressFieldMappings.Enabled)341 {342 StreetAddress address = ParsedAddress;343 sb.Append("\"" + StringUtils.EscapeChar(address.Number, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //64344 sb.Append("\"" + StringUtils.EscapeChar(address.NumberFractional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //65345 sb.Append("\"" + StringUtils.EscapeChar(address.PreDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //66346 sb.Append("\"" + StringUtils.EscapeChar(address.PreQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //67347 sb.Append("\"" + StringUtils.EscapeChar(address.PreType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //68348 sb.Append("\"" + StringUtils.EscapeChar(address.PreArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //69349 sb.Append("\"" + StringUtils.EscapeChar(address.StreetName, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //70350 sb.Append("\"" + StringUtils.EscapeChar(address.PostArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //71351 sb.Append("\"" + StringUtils.EscapeChar(address.PostQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //72352 sb.Append("\"" + StringUtils.EscapeChar(address.Suffix, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //73353 sb.Append("\"" + StringUtils.EscapeChar(address.PostDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //74354 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //75355 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //76356 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //77357 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //78358 sb.Append("\"" + StringUtils.EscapeChar(address.City, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //79359 sb.Append("\"" + StringUtils.EscapeChar(address.ConsolidatedCity, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //80360 sb.Append("\"" + StringUtils.EscapeChar(address.MinorCivilDivision, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //81361 sb.Append("\"" + StringUtils.EscapeChar(address.CountySubregion, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //82362 sb.Append("\"" + StringUtils.EscapeChar(address.County, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //83363 sb.Append("\"" + StringUtils.EscapeChar(address.State, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //84364 sb.Append("\"" + StringUtils.EscapeChar(address.ZIP, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //85365 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus1, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //86366 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus2, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //87367 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus3, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //88368 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus4, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //89369 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus5, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //90370 }371 if (options == null || options.OutputReferenceFeatureFieldMappings.Enabled)372 {373 StreetAddress address = MatchedFeatureAddress;374 sb.Append("\"" + StringUtils.EscapeChar(address.Number, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //91375 sb.Append("\"" + StringUtils.EscapeChar(address.NumberFractional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //92376 sb.Append("\"" + StringUtils.EscapeChar(address.PreDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //93377 sb.Append("\"" + StringUtils.EscapeChar(address.PreQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //94378 sb.Append("\"" + StringUtils.EscapeChar(address.PreType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //95379 sb.Append("\"" + StringUtils.EscapeChar(address.PreArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //96380 sb.Append("\"" + StringUtils.EscapeChar(address.StreetName, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //97381 sb.Append("\"" + StringUtils.EscapeChar(address.PostArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //98382 sb.Append("\"" + StringUtils.EscapeChar(address.PostQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //99383 sb.Append("\"" + StringUtils.EscapeChar(address.Suffix, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //100384 sb.Append("\"" + StringUtils.EscapeChar(address.PostDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //101385 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //102386 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //103387 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //104388 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //105389 sb.Append("\"" + StringUtils.EscapeChar(address.City, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //106390 sb.Append("\"" + StringUtils.EscapeChar(address.ConsolidatedCity, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //107391 sb.Append("\"" + StringUtils.EscapeChar(address.MinorCivilDivision, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //108392 sb.Append("\"" + StringUtils.EscapeChar(address.CountySubregion, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //109393 sb.Append("\"" + StringUtils.EscapeChar(address.County, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //110394 sb.Append("\"" + StringUtils.EscapeChar(address.State, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //111395 sb.Append("\"" + StringUtils.EscapeChar(address.ZIP, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //112396 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus1, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //113397 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus2, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //114398 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus3, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //115399 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus4, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //116400 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus5, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //117401 if (MatchedFeature.MatchedReferenceFeature != null)402 {403 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.Area.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); ; //118404 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.AreaUnits.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); ; //119405 }406 else407 {408 sb.Append("\"\"").Append(separator); ; //118409 sb.Append("\"\"").Append(separator); ; //119410 }411 string gml = "";412 string wkt = "";413 int srid = 0;414 if (MatchedFeature != null && MatchedFeature.MatchedReferenceFeature != null)415 {416 if (MatchedFeature != null && MatchedFeature.MatchedReferenceFeature != null)417 {418 if (MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry != null)419 {420 if (MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.SqlGeometry != null && !MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.SqlGeometry.IsNull)421 {422 if (options.ShouldOutputReferenceFeatureGeometry)423 {424 srid = MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.SRID;425 //BUG:ZI140 Switching to using WKT here for simplicity and functionality426 //gml = MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.SqlGeometry.AsGml().Value;427 wkt = MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.SqlGeometry.ToString();428 }429 }430 }431 }432 }433 sb.Append("\"" + StringUtils.EscapeChar(srid.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //120434 if (String.Compare(separator, ",", true) == 0)435 {436 //BUG:ZI140 Switching to using WKT here for simplicity and functionality437 //sb.Append("\"" + StringUtils.EscapeChar(gml.Replace(separator, ";"), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //121438 sb.Append("\"" + StringUtils.EscapeChar(wkt.Replace(separator, ";"), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //121439 }440 else441 {442 //BUG:ZI140 Switching to using WKT here for simplicity and functionality443 sb.Append("\"" + StringUtils.EscapeChar(wkt, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //121444 }445 sb.Append("\"" + StringUtils.EscapeChar(SourceType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //122446 sb.Append("\"" + StringUtils.EscapeChar(SourceVintage, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //123447 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.PrimaryIdField, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //124448 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.PrimaryIdValue, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //125449 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.SecondaryIdField, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //126450 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.SecondaryIdValue, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //127451 }452 return sb.ToString();453 }454 }455}...
FlatGeocode.cs
Source:FlatGeocode.cs
...93 }94 public override string AsStringVerbose_V03_01(string separator, double version, BatchOptions options)95 {96 StringBuilder sb = new StringBuilder();97 sb.Append("\"" + StringUtils.EscapeChar(Latitude.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //398 sb.Append("\"" + StringUtils.EscapeChar(Longitude.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //499 sb.Append("\"" + StringUtils.EscapeChar(NAACCRGISCoordinateQualityCode, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //5100 sb.Append("\"" + StringUtils.EscapeChar(NAACCRGISCoordinateQualityType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //6101 sb.Append("\"" + StringUtils.EscapeChar(MatchScore.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //7102 sb.Append("\"" + StringUtils.EscapeChar(MatchType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //8103 sb.Append("\"" + StringUtils.EscapeChar(FM_GeographyType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //9104 sb.Append("\"" + StringUtils.EscapeChar(RegionSize, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //10105 sb.Append("\"" + StringUtils.EscapeChar(RegionSizeUnits, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //11106 sb.Append("\"" + StringUtils.EscapeChar(InterpolationType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //12107 sb.Append("\"" + StringUtils.EscapeChar(InterpolationSubType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //13108 sb.Append("\"" + StringUtils.EscapeChar(MatchedLocationType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //14109 sb.Append("\"" + StringUtils.EscapeChar(FM_ResultType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //15110 sb.Append("\"" + StringUtils.EscapeChar(FM_ResultCount.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //16111 sb.Append("\"" + StringUtils.EscapeChar(FM_Notes, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //17112 sb.Append("\"" + StringUtils.EscapeChar(FM_TieNotes, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //18113 sb.Append("\"" + StringUtils.EscapeChar(FM_TieStrategy.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //19114 sb.Append("\"" + StringUtils.EscapeChar(FM_SelectionMethod.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //20115 sb.Append("\"" + StringUtils.EscapeChar(FM_SelectionNotes, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21116 if (options == null || options.OutputBookKeepingFieldMappings.Enabled)117 {118 sb.Append("\"" + StringUtils.EscapeChar(Version.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21119 sb.Append("\"" + StringUtils.EscapeChar(QueryStatusCodes.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //2120 sb.Append("\"" + StringUtils.EscapeChar(TimeTaken.TotalMilliseconds.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21121 sb.Append("\"" + StringUtils.EscapeChar(TransactionId, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21122 sb.Append("\"" + StringUtils.EscapeChar(GeocoderName, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21123 sb.Append("\"" + StringUtils.EscapeChar(ErrorMessage, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21124 sb.Append("\"" + StringUtils.EscapeChar(1.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21125 sb.Append("\"" + StringUtils.EscapeChar(RecordId, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //21126 }127 if (options == null || options.OutputCensusFieldMappings.Enabled)128 {129 sb.Append("\"" + StringUtils.EscapeChar(CensusYear.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //23130 sb.Append("\"" + StringUtils.EscapeChar(NAACCRCensusTractCertaintyCode, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //24131 sb.Append("\"" + StringUtils.EscapeChar(NAACCRCensusTractCertaintyType.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //25132 sb.Append("\"" + StringUtils.EscapeChar(CensusBlock, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //26133 sb.Append("\"" + StringUtils.EscapeChar(CensusBlockGroup, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //27134 sb.Append("\"" + StringUtils.EscapeChar(CensusTract, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //28135 sb.Append("\"" + StringUtils.EscapeChar(CensusCountyFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //29136 sb.Append("\"" + StringUtils.EscapeChar(CensusCbsaFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //30137 sb.Append("\"" + StringUtils.EscapeChar(CensusCbsaMicro, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //31138 sb.Append("\"" + StringUtils.EscapeChar(CensusMcdFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //32139 sb.Append("\"" + StringUtils.EscapeChar(CensusMetDivFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //33140 sb.Append("\"" + StringUtils.EscapeChar(CensusMsaFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //34141 sb.Append("\"" + StringUtils.EscapeChar(CensusPlaceFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //35142 sb.Append("\"" + StringUtils.EscapeChar(CensusStateFips, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //36143 }144 if (options == null || options.OutputInputAddressFieldMappings.Enabled)145 {146 StreetAddress address = InputAddress;147 sb.Append("\"" + StringUtils.EscapeChar(address.Number, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //37148 sb.Append("\"" + StringUtils.EscapeChar(address.NumberFractional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //38149 sb.Append("\"" + StringUtils.EscapeChar(address.PreDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //39150 sb.Append("\"" + StringUtils.EscapeChar(address.PreQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //40151 sb.Append("\"" + StringUtils.EscapeChar(address.PreType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //41152 sb.Append("\"" + StringUtils.EscapeChar(address.PreArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //42153 sb.Append("\"" + StringUtils.EscapeChar(address.StreetName, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //43154 sb.Append("\"" + StringUtils.EscapeChar(address.PostArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //44155 sb.Append("\"" + StringUtils.EscapeChar(address.PostQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //45156 sb.Append("\"" + StringUtils.EscapeChar(address.Suffix, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //46157 sb.Append("\"" + StringUtils.EscapeChar(address.PostDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //47158 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //48159 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //49160 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //50161 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //51162 sb.Append("\"" + StringUtils.EscapeChar(address.City, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //52163 sb.Append("\"" + StringUtils.EscapeChar(address.ConsolidatedCity, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //53164 sb.Append("\"" + StringUtils.EscapeChar(address.MinorCivilDivision, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //54165 sb.Append("\"" + StringUtils.EscapeChar(address.CountySubregion, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //55166 sb.Append("\"" + StringUtils.EscapeChar(address.County, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //56167 sb.Append("\"" + StringUtils.EscapeChar(address.State, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //57168 sb.Append("\"" + StringUtils.EscapeChar(address.ZIP, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //58169 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus1, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //59170 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus2, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //60171 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus3, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //61172 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus4, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //62173 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus5, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //63174 }175 if (options == null || options.OutputMatchedAddressFieldMappings.Enabled)176 {177 StreetAddress address = MatchedAddress;178 sb.Append("\"" + StringUtils.EscapeChar(address.Number, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //37179 sb.Append("\"" + StringUtils.EscapeChar(address.NumberFractional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //38180 sb.Append("\"" + StringUtils.EscapeChar(address.PreDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //39181 sb.Append("\"" + StringUtils.EscapeChar(address.PreQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //40182 sb.Append("\"" + StringUtils.EscapeChar(address.PreType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //41183 sb.Append("\"" + StringUtils.EscapeChar(address.PreArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //42184 sb.Append("\"" + StringUtils.EscapeChar(address.StreetName, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //43185 sb.Append("\"" + StringUtils.EscapeChar(address.PostArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //44186 sb.Append("\"" + StringUtils.EscapeChar(address.PostQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //45187 sb.Append("\"" + StringUtils.EscapeChar(address.Suffix, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //46188 sb.Append("\"" + StringUtils.EscapeChar(address.PostDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //47189 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //48190 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //49191 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //50192 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //51193 sb.Append("\"" + StringUtils.EscapeChar(address.City, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //52194 sb.Append("\"" + StringUtils.EscapeChar(address.ConsolidatedCity, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //53195 sb.Append("\"" + StringUtils.EscapeChar(address.MinorCivilDivision, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //54196 sb.Append("\"" + StringUtils.EscapeChar(address.CountySubregion, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //55197 sb.Append("\"" + StringUtils.EscapeChar(address.County, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //56198 sb.Append("\"" + StringUtils.EscapeChar(address.State, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //57199 sb.Append("\"" + StringUtils.EscapeChar(address.ZIP, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //58200 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus1, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //59201 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus2, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //60202 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus3, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //61203 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus4, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //62204 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus5, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //63205 }206 if (options == null || options.OutputParsedAddressFieldMappings.Enabled)207 {208 StreetAddress address = ParsedAddress;209 sb.Append("\"" + StringUtils.EscapeChar(address.Number, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //64210 sb.Append("\"" + StringUtils.EscapeChar(address.NumberFractional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //65211 sb.Append("\"" + StringUtils.EscapeChar(address.PreDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //66212 sb.Append("\"" + StringUtils.EscapeChar(address.PreQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //67213 sb.Append("\"" + StringUtils.EscapeChar(address.PreType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //68214 sb.Append("\"" + StringUtils.EscapeChar(address.PreArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //69215 sb.Append("\"" + StringUtils.EscapeChar(address.StreetName, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //70216 sb.Append("\"" + StringUtils.EscapeChar(address.PostArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //71217 sb.Append("\"" + StringUtils.EscapeChar(address.PostQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //72218 sb.Append("\"" + StringUtils.EscapeChar(address.Suffix, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //73219 sb.Append("\"" + StringUtils.EscapeChar(address.PostDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //74220 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //75221 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //76222 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //77223 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //78224 sb.Append("\"" + StringUtils.EscapeChar(address.City, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //79225 sb.Append("\"" + StringUtils.EscapeChar(address.ConsolidatedCity, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //80226 sb.Append("\"" + StringUtils.EscapeChar(address.MinorCivilDivision, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //81227 sb.Append("\"" + StringUtils.EscapeChar(address.CountySubregion, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //82228 sb.Append("\"" + StringUtils.EscapeChar(address.County, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //83229 sb.Append("\"" + StringUtils.EscapeChar(address.State, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //84230 sb.Append("\"" + StringUtils.EscapeChar(address.ZIP, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //85231 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus1, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //86232 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus2, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //87233 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus3, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //88234 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus4, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //89235 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus5, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //90236 }237 if (options == null || options.OutputReferenceFeatureFieldMappings.Enabled)238 {239 StreetAddress address = MatchedFeatureAddress;240 sb.Append("\"" + StringUtils.EscapeChar(address.Number, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //91241 sb.Append("\"" + StringUtils.EscapeChar(address.NumberFractional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //92242 sb.Append("\"" + StringUtils.EscapeChar(address.PreDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //93243 sb.Append("\"" + StringUtils.EscapeChar(address.PreQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //94244 sb.Append("\"" + StringUtils.EscapeChar(address.PreType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //95245 sb.Append("\"" + StringUtils.EscapeChar(address.PreArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //96246 sb.Append("\"" + StringUtils.EscapeChar(address.StreetName, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //97247 sb.Append("\"" + StringUtils.EscapeChar(address.PostArticle, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //98248 sb.Append("\"" + StringUtils.EscapeChar(address.PostQualifier, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //99249 sb.Append("\"" + StringUtils.EscapeChar(address.Suffix, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //100250 sb.Append("\"" + StringUtils.EscapeChar(address.PostDirectional, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //101251 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //102252 sb.Append("\"" + StringUtils.EscapeChar(address.SuiteNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //103253 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //104254 sb.Append("\"" + StringUtils.EscapeChar(address.PostOfficeBoxNumber, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //105255 sb.Append("\"" + StringUtils.EscapeChar(address.City, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //106256 sb.Append("\"" + StringUtils.EscapeChar(address.ConsolidatedCity, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //107257 sb.Append("\"" + StringUtils.EscapeChar(address.MinorCivilDivision, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //108258 sb.Append("\"" + StringUtils.EscapeChar(address.CountySubregion, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //109259 sb.Append("\"" + StringUtils.EscapeChar(address.County, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //110260 sb.Append("\"" + StringUtils.EscapeChar(address.State, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //111261 sb.Append("\"" + StringUtils.EscapeChar(address.ZIP, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //112262 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus1, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //113263 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus2, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //114264 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus3, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //115265 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus4, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //116266 sb.Append("\"" + StringUtils.EscapeChar(address.ZIPPlus5, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //117267 if (MatchedFeature.MatchedReferenceFeature != null)268 {269 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.Area.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); ; //118270 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.AreaUnits.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); ; //119271 }272 else273 {274 sb.Append("\"\"").Append(separator); ; //118275 sb.Append("\"\"").Append(separator); ; //119276 }277 string gml = "";278 string wkt = "";279 int srid = 0;280 if (MatchedFeature != null && MatchedFeature.MatchedReferenceFeature != null)281 {282 if (MatchedFeature != null && MatchedFeature.MatchedReferenceFeature != null)283 {284 if (MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry != null)285 {286 if (MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.SqlGeometry != null && !MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.SqlGeometry.IsNull)287 {288 if (options.ShouldOutputReferenceFeatureGeometry)289 {290 srid = MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.SRID;291 //BUG:ZI140 Switching to using WKT here for simplicity and functionality292 //gml = MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.SqlGeometry.AsGml().Value;293 wkt = MatchedFeature.MatchedReferenceFeature.StreetAddressableGeographicFeature.Geometry.SqlGeometry.ToString();294 }295 }296 }297 }298 }299 sb.Append("\"" + StringUtils.EscapeChar(srid.ToString(), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //120300 if (String.Compare(separator, ",", true) == 0)301 {302 //BUG:ZI140 Switching to using WKT here for simplicity and functionality303 //sb.Append("\"" + StringUtils.EscapeChar(gml.Replace(separator, ";"), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //121304 sb.Append("\"" + StringUtils.EscapeChar(wkt.Replace(separator, ";"), "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //121305 }306 else307 {308 //BUG:ZI140 Switching to using WKT here for simplicity and functionality309 //sb.Append("\"" + StringUtils.EscapeChar(gml, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //121310 sb.Append("\"" + StringUtils.EscapeChar(wkt, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //121311 }312 sb.Append("\"" + StringUtils.EscapeChar(SourceType, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //122313 sb.Append("\"" + StringUtils.EscapeChar(SourceVintage, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //123314 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.PrimaryIdField, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //124315 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.PrimaryIdValue, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //125316 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.SecondaryIdField, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //126317 sb.Append("\"" + StringUtils.EscapeChar(MatchedFeature.SecondaryIdValue, "\"", StringUtils.EsacpeCharAction.repeat) + "\"").Append(separator); //127318 }319 return sb.ToString();320 }321 }322}...
StringUtilsTests.cs
Source:StringUtilsTests.cs
...2930namespace Spring.Util31{32 /// <summary>33 /// Unit tests for the StringUtils class.34 /// </summary>35 /// <author>Aleksandar Seovic</author>36 /// <author>Rick Evans</author>37 /// <author>Griffin Caprio</author>38 [TestFixture]39 public sealed class StringUtilsTests40 {41 [Test]42 public void SplitTests()43 {44 string testString = " a,b,, c ,d\n:e ";45 string delim = ",\n";46 string[] res;47 string[] res1 = new string[] {" a", "b", "", " c ", "d", ":e "};48 string[] res2 = new string[] {" a", "b", " c ", "d", ":e "};49 string[] res3 = new string[] {"a", "b", "", "c", "d", ":e"};50 string[] res4 = new string[] {"a", "b", "c", "d", ":e"};5152 Assert.AreEqual(0, StringUtils.Split(null, null, false, false).Length);53 Assert.AreEqual(testString, StringUtils.Split(testString, null, false, false)[0]);54 Assert.IsTrue(ArrayUtils.AreEqual(res1, res = StringUtils.Split(testString, delim, false, false)), "Received '" + String.Join(",", res) + "'");55 Assert.IsTrue(ArrayUtils.AreEqual(res2, res = StringUtils.Split(testString, delim, false, true)), "Received '" + String.Join(",", res) + "'");56 Assert.IsTrue(ArrayUtils.AreEqual(res3, res = StringUtils.Split(testString, delim, true, false)), "Received '" + String.Join(",", res) + "'");57 Assert.IsTrue(ArrayUtils.AreEqual(res4, res = StringUtils.Split(testString, delim, true, true)), "Received '" + String.Join(",", res) + "'");5859 Assert.IsTrue(ArrayUtils.AreEqual(new string[] {"one"}, res = StringUtils.Split("one", delim, true, true)), "Received '" + String.Join(",", res) + "'");60 }6162 [Test]63 public void SplitWithQuotedStrings()64 {65 string[] expectedParts = new string[] { "a", "[test,<,>>[]]]", "asdf<,<,>,>aa" };66 string testString = string.Join(",", expectedParts);67 string[] result = StringUtils.Split(testString, ",", false, false, "[]<>");68 Assert.AreEqual( expectedParts, result );69 }7071 [Test]72 public void SplitAddsEmptyStrings()73 {74 string testString = ",";75 string[] result = StringUtils.Split(testString, ",", true, false, null);76 Assert.AreEqual( new string[] { "", "" }, result );77 }7879 [Test]80 public void SplitAcceptsWhitespaceDelimiters()81 {82 string testString = "a\nb\tc d";83 string[] result = StringUtils.Split(testString, "\n\t ", true, false, null);84 Assert.AreEqual( new string[] { "a", "b", "c", "d" }, result );85 }8687 [Test]88 public void HasLengthTests()89 {90 Assert.IsFalse(StringUtils.HasLength(null));91 Assert.IsFalse(StringUtils.HasLength(""));92 Assert.IsTrue(StringUtils.HasLength(" "));93 Assert.IsTrue(StringUtils.HasLength("Hello"));94 }9596 [Test]97 public void HasTextTests()98 {99 Assert.IsFalse(StringUtils.HasText(null));100 Assert.IsFalse(StringUtils.HasText(""));101 Assert.IsFalse(StringUtils.HasText(" "));102 Assert.IsTrue(StringUtils.HasText("12345"));103 Assert.IsTrue(StringUtils.HasText(" 12345 "));104 }105106 [Test]107 public void IsNullOrEmptyTests()108 {109 Assert.IsTrue(StringUtils.IsNullOrEmpty(null));110 Assert.IsTrue(StringUtils.IsNullOrEmpty(""));111 Assert.IsTrue(StringUtils.IsNullOrEmpty(" "));112 Assert.IsFalse(StringUtils.IsNullOrEmpty("12345"));113 Assert.IsFalse(StringUtils.IsNullOrEmpty(" 12345 "));114 }115116 [Test]117 public void CollectionToDelimitedString()118 {119 Foo[] arr = new Foo[] {new Foo("Foo"), new Foo("Bar")};120 Assert.AreEqual(121 ":Foo,:Bar", StringUtils.CollectionToCommaDelimitedString(arr));122123 Assert.AreEqual("null", StringUtils.CollectionToCommaDelimitedString<object>(null));124 }125126 [Test]127 public void ArrayToDelimitedString()128 {129 Foo[] arr = new Foo[] {new Foo("Foo"), new Foo("Bar")};130 Assert.AreEqual(131 ":Foo,:Bar", StringUtils.CollectionToCommaDelimitedString(arr));132 Assert.AreEqual("null", StringUtils.CollectionToCommaDelimitedString<object>(null));133 }134135 [Test]136 public void DelimitedListToStringArray()137 {138 string[] expected = new string[] {"Foo", "", "Bar"};139 string input = "Foo,,Bar";140 string[] actual = StringUtils.DelimitedListToStringArray(input, ",");141 Assert.IsNotNull(actual);142 Assert.AreEqual(expected.Length, actual.Length);143 for (int i = 0; i < actual.Length; ++i)144 {145 Assert.AreEqual(expected[i], actual[i]);146 }147 }148149 [Test]150 public void DelimitedListToStringArrayWithEmptyStringDelimiter()151 {152 string input = "Foo,,Bar";153 string[] expected = new string[] {input};154 string[] actual = StringUtils.DelimitedListToStringArray(input, string.Empty);155 Assert.IsNotNull(actual);156 Assert.AreEqual(expected.Length, actual.Length);157 for (int i = 0; i < actual.Length; ++i)158 {159 Assert.AreEqual(expected[i], actual[i]);160 }161 }162163 [Test]164 public void DelimitedListToStringArrayWithGuff()165 {166 string[] expected = new string[] {};167 string[] actual = StringUtils.DelimitedListToStringArray(null, null);168 Assert.IsNotNull(actual);169 Assert.AreEqual(expected.Length, actual.Length);170171 string aString = "HungerHurtsButStarvingWorks...";172 expected = new string[] {aString};173 actual = StringUtils.DelimitedListToStringArray(aString, null);174 Assert.IsNotNull(actual);175 Assert.AreEqual(expected.Length, actual.Length);176 Assert.AreEqual(aString, actual[0]);177 }178179 [Test]180 public void StripFirstAndLastCharacterWithNull()181 {182 string actual = StringUtils.StripFirstAndLastCharacter(null);183 Assert.IsNotNull(actual, "StringUtils.StripFirstAndLastCharacter(null) should return String.Empty.");184 Assert.AreEqual(String.Empty, actual, "StringUtils.StripFirstAndLastCharacter(null) should return String.Empty.");185 }186187 [Test]188 public void StripFirstAndLastCharacterWithEmptyString()189 {190 string actual = StringUtils.StripFirstAndLastCharacter(String.Empty);191 Assert.IsNotNull(actual, "StringUtils.StripFirstAndLastCharacter(String.Empty) should return String.Empty.");192 Assert.AreEqual(String.Empty, actual, "StringUtils.StripFirstAndLastCharacter(String.Empty) should return String.Empty.");193 }194195 [Test]196 public void StripFirstAndLastCharacterWithReallyShortStrings()197 {198 string actual = StringUtils.StripFirstAndLastCharacter("B");199 Assert.IsNotNull(actual, "StringUtils.StripFirstAndLastCharacter(\"B\") should return String.Empty.");200 Assert.AreEqual(String.Empty, actual, "StringUtils.StripFirstAndLastCharacter(\"B\") should return String.Empty.");201202 actual = StringUtils.StripFirstAndLastCharacter("BF");203 Assert.IsNotNull(actual, "StringUtils.StripFirstAndLastCharacter(\"BF\") should return String.Empty.");204 Assert.AreEqual(String.Empty, actual, "StringUtils.StripFirstAndLastCharacter(\"BF\") should return String.Empty.");205 }206207 [Test]208 public void StripFirstAndLastCharacterWorksLikeACharm()209 {210 string actual = StringUtils.StripFirstAndLastCharacter("There are 17 steps to winding up a bird chronicle correctly");211 Assert.IsNotNull(actual);212 Assert.AreEqual("here are 17 steps to winding up a bird chronicle correctl", actual);213 }214215 [Test]216 public void GetAntExpressionsWithNull()217 {218 IList<string> actual = StringUtils.GetAntExpressions(null);219 Assert.IsNotNull(actual);220 string[] expected = new string[] {};221 Assert.IsTrue(ArrayUtils.AreEqual(expected, new List<string>(actual).ToArray()));222 }223224 [Test]225 public void GetAntExpressionsWithEmptyString()226 {227 IList<string> actual = StringUtils.GetAntExpressions(String.Empty);228 Assert.IsNotNull(actual);229 string[] expected = new string[] {};230 Assert.IsTrue(ArrayUtils.AreEqual(expected, new List<string>(actual).ToArray()));231 }232233 [Test]234 public void GetAntExpressionsWithAStringThatDoesntHaveAnyExpressions()235 {236 IList<string> actual = StringUtils.GetAntExpressions("I could really go a cup of tea right now... in fact I think I'll go get one.");237 Assert.IsNotNull(actual);238 string[] expected = new string[] {};239 Assert.IsTrue(ArrayUtils.AreEqual(expected, new List<string>(actual).ToArray()));240 }241242 [Test]243 public void GetAntExpressionsWithAValidExpression()244 {245 IList<string> actual = StringUtils.GetAntExpressions("${slurp}. Ah! That is one good cup of tea. That agent Cooper and his coffee... he sure was missing out on a good thing.");246 CheckGetAntExpressions(actual, "slurp");247 }248249 [Test]250 public void GetAntExpressionsWithANestedExpression()251 {252 IList<string> actual = StringUtils.GetAntExpressions("And yeah, I've never been a fan of the doughnut... ${blechh${shudder}}");253 CheckGetAntExpressions(actual, "blechh${shudder");254 }255256 [Test]257 public void GetAntExpressionsWithACoupleOfDuplicatedValidExpressions()258 {259 IList<string> actual = StringUtils.GetAntExpressions("${sigh}. Laura Palmer though... man, that sure was a tragedy. ${sigh}");260 CheckGetAntExpressions(actual, "sigh");261 }262263 [Test]264 public void GetAntExpressionsWithACoupleOfUniqueValidExpressions()265 {266 IList<string> actual = StringUtils.GetAntExpressions("${Mmm}. Has there been any good telly since then... ${thinks}");267 CheckGetAntExpressions(actual, "Mmm", "thinks");268 }269270 [Test]271 public void GetAntExpressionsWithMalformedExpression()272 {273 IList<string> actual = StringUtils.GetAntExpressions("Mmm... just what counts as ${a malformed{ expression?");274 CheckGetAntExpressions(actual, new string[] {});275 }276277 private static void CheckGetAntExpressions(IList<string> actual, params string[] expected)278 {279 Assert.IsNotNull(actual);280 Assert.IsTrue(ArrayUtils.AreEqual(281 expected,282 new List<string>(actual).ToArray()));283 }284285 [Test]286 public void GetAntExpressionsIgnoresEmptyExpression()287 {288 Assert.Throws<FormatException>(() => StringUtils.GetAntExpressions("This is an empty expression ${}..."));289 }290291 [Test]292 public void SetAntExpressionWithNullText()293 {294 string expected = String.Empty;295 string actual = StringUtils.SetAntExpression(null, "foo", "bar");296 Assert.IsNotNull(actual);297 Assert.AreEqual(expected, actual);298 }299300 [Test]301 public void SetAntExpressionWithEmptyStringExpression()302 {303 string expected = String.Empty;304 string actual = StringUtils.SetAntExpression(" ", "foo", "bar");305 Assert.IsNotNull(actual);306 Assert.AreEqual(expected, actual);307 }308309 [Test]310 public void SetAntExpressionWithMultipleEvaluations()311 {312 string expected = "Hey, do you want to hear the most annoying sound in the world? Mehhh! Mehhh!";313 string actual = StringUtils.SetAntExpression("Hey, do you want to hear the most annoying sound in the world? ${foo}! ${foo}!", "foo", "Mehhh");314 Assert.IsNotNull(actual);315 Assert.AreEqual(expected, actual);316 }317318 [Test]319 public void SetAntExpressionWithNullReplacementValue()320 {321 string expected = "That John Denver... he's full of .";322 string actual = StringUtils.SetAntExpression("That John Denver... he's full of ${bleep}.", "bleep", null);323 Assert.IsNotNull(actual);324 Assert.AreEqual(expected, actual);325 }326327 [Test]328 public void FullSurroundWithNulls()329 {330 Assert.AreEqual("Hi", StringUtils.Surround(null, "Hi", null));331 }332333 [Test]334 public void FullSurroundWithEmptyStrings()335 {336 Assert.AreEqual("Hi", StringUtils.Surround(string.Empty, "Hi", string.Empty));337 }338339 [Test]340 public void FullSurround()341 {342 Assert.AreEqual("[Hi]", StringUtils.Surround("[", "Hi", "]"));343 }344345 [Test]346 public void FullSurroundNullWithEmptyStrings()347 {348 Assert.AreEqual(string.Empty, StringUtils.Surround(string.Empty, null, string.Empty));349 }350351 [Test]352 public void FullSurroundEmptyStringWithEmptyStrings()353 {354 Assert.AreEqual(string.Empty, StringUtils.Surround(string.Empty, string.Empty, string.Empty));355 }356357 [Test]358 public void FullSurroundNullWithNulls()359 {360 Assert.AreEqual(string.Empty, StringUtils.Surround(null, null, null));361 }362363 [Test]364 public void SurroundWithEmptyStrings()365 {366 Assert.AreEqual("Hi", StringUtils.Surround(string.Empty, "Hi"));367 }368369 [Test]370 public void Surround()371 {372 Assert.AreEqual("-Hi-", StringUtils.Surround("-", "Hi"));373 }374375 [Test]376 public void SurroundNullWithEmptyStrings()377 {378 Assert.AreEqual(string.Empty, StringUtils.Surround(string.Empty, null));379 }380381 [Test]382 public void SurroundEmptyStringWithEmptyStrings()383 {384 Assert.AreEqual(string.Empty, StringUtils.Surround(string.Empty, string.Empty));385 }386387 [Test]388 public void SurroundNullWithNulls()389 {390 Assert.AreEqual(string.Empty, StringUtils.Surround(null, null));391 }392393 [Test]394 public void FullSurroundObjectWithNulls()395 {396 Assert.AreEqual(":Hi", StringUtils.Surround(null, new Foo("Hi"), null));397 }398399 [Test]400 public void FullSurroundObjectWithEmptyStrings()401 {402 Assert.AreEqual(":Hi", StringUtils.Surround(string.Empty, new Foo("Hi"), string.Empty));403 }404405 [Test]406 public void FullSurroundObject()407 {408 Assert.AreEqual("[:Hi]", StringUtils.Surround("[", new Foo("Hi"), "]"));409 }410411 [Test]412 public void SurroundObjectWithEmptyStrings()413 {414 Assert.AreEqual(":Hi", StringUtils.Surround(string.Empty, new Foo("Hi"), string.Empty));415 }416417 [Test]418 public void SurroundObject()419 {420 Assert.AreEqual("[:Hi]", StringUtils.Surround("[", new Foo("Hi"), "]"));421 }422423 [Test]424 public void ConvertEscapedCharactersNoEscapedCharacters()425 {426 string inputString = "foo bar is a funny term";427 Assert.AreEqual(inputString, StringUtils.ConvertEscapedCharacters(inputString));428 }429430 [Test]431 public void ConvertEscapedCharactersAll()432 {433 string inputString = "newline\\n tab\\t return\\r";434 Assert.AreEqual("newline\n tab\t return\r", StringUtils.ConvertEscapedCharacters(inputString));435 }436437 [Test]438 public void ConvertUnsupportedEscapedCharacters()439 {440 string inputString = "what is this\\g";441 Assert.AreEqual(inputString, StringUtils.ConvertEscapedCharacters(inputString));442 }443444 private sealed class Foo445 {446 public Foo(string bar)447 {448 this.bar = bar;449 }450451 public override string ToString()452 {453 return ":" + bar;454 }455
...
VistaLocationDao.cs
Source:VistaLocationDao.cs
...35 if (String.IsNullOrEmpty(response))36 {37 return null;38 }39 string[] lines = StringUtils.split(response, StringUtils.CRLF);40 List<SiteId> result = new List<SiteId>();41 for (int i = 0; i < lines.Length; i++)42 {43 if (String.IsNullOrEmpty(lines[i]))44 {45 continue;46 }47 string[] flds = StringUtils.split(lines[i], StringUtils.CARET);48 result.Add(new SiteId(flds[1], flds[0]));49 }50 return result;51 }52 public OrderedDictionary getClinicsByName(string name)53 {54 MdoQuery request = buildGetClinicsByNameRequest(name);55 string response = (string)cxn.query(request, new MenuOption("AMOJ VL CPGPI"));56 return clinicNamesToMdo(response);57 }58 internal MdoQuery buildGetClinicsByNameRequest(string name)59 {60 VistaQuery vq = new VistaQuery("AMOJVL CPGPI CLLOOK");61 vq.addParameter(vq.LITERAL, name);62 return vq;63 }64 internal OrderedDictionary clinicNamesToMdo(string response)65 {66 if (String.IsNullOrEmpty(response))67 {68 return null;69 }70 string[] lines = StringUtils.split(response, StringUtils.CRLF);71 OrderedDictionary result = new OrderedDictionary();72 for (int i = 0; i < lines.Length; i++)73 {74 if (String.IsNullOrEmpty(lines[i]))75 {76 continue;77 }78 string[] flds = StringUtils.split(lines[i], StringUtils.CARET);79 result.Add(flds[1], flds[0]);80 }81 return result;82 }83 #region Scheduling84 #region Clinic Details85 /// <summary>86 /// Get the details of a clinic87 /// </summary>88 /// <param name="locationIen">The IEN of the clinic in the HospitalLocation file</param>89 /// <returns></returns>90 public HospitalLocation getClinicDetails(string locationIen)91 {92 MdoQuery request = buildGetClinicDetailsRequest(locationIen);93 string response = (string)cxn.query(request);94 return toLocation(response);95 }96 internal MdoQuery buildGetClinicDetailsRequest(string locationIen)97 {98 VistaQuery query = new VistaQuery("SD GET CLINIC DETAILS");99 query.addParameter(query.LITERAL, locationIen);100 return query;101 }102 // TODO - need to finish parsing103 internal HospitalLocation toLocation(string response)104 {105 HospitalLocation location = new HospitalLocation();106 if (String.IsNullOrEmpty(response))107 {108 return location;109 }110 string[] lines = StringUtils.split(response, StringUtils.CRLF);111 foreach (string line in lines)112 {113 if (String.IsNullOrEmpty(line))114 {115 continue;116 }117 string[] pieces = StringUtils.split(line, StringUtils.EQUALS);118 if (pieces.Length < 2)119 {120 continue;121 }122 pieces[0] = pieces[0].Replace("RESULT(\"", "");123 pieces[0] = pieces[0].Replace("\")", "");124 switch (pieces[0])125 {126 case "ABBREVIATION" :127 location.Abbr = StringUtils.split(pieces[1], StringUtils.CARET)[0];128 break;129 case "DIVISION":130 location.Division = new KeyValuePair<string, string>(131 StringUtils.split(pieces[1], StringUtils.CARET)[0], StringUtils.split(pieces[1], StringUtils.CARET)[1]);132 break;133 case "NAME":134 location.Name = StringUtils.split(pieces[1], StringUtils.CARET)[0];135 break;136 case "TREATING SPECIALTY":137 location.Specialty = new KeyValuePair<string,string>(138 StringUtils.split(pieces[1], StringUtils.CARET)[0], StringUtils.split(pieces[1], StringUtils.CARET)[1]);139 break;140 case "TYPE" :141 location.Type = StringUtils.split(pieces[1], StringUtils.CARET)[1];142 break;143 case "TYPE EXTENSION" :144 location.TypeExtension = new KeyValuePair<string,string>(145 StringUtils.split(pieces[1], StringUtils.CARET)[0], StringUtils.split(pieces[1], StringUtils.CARET)[1]);146 break;147 default:148 break;149 }150 }151 return location;152 }153 #endregion154 #region Get Clinics By Name155 /// <summary>156 /// Get the entire list of clincs157 /// </summary>158 /// <returns></returns>159 public IList<HospitalLocation> getAllClinics()160 {161 MdoQuery request = buildGetAllClinicsRequest();162 string response = (string)cxn.query(request);163 return toAllClinics(response);164 }165 internal MdoQuery buildGetAllClinicsRequest()166 {167 VistaQuery query = new VistaQuery("SD GET CLINICS BY NAME");168 query.addParameter(query.LITERAL, ""); // SEARCH169 query.addParameter(query.LITERAL, ""); // START - LEAVING BLANK SEEMS TO START AT BEGINNING OF ALPHABET170 query.addParameter(query.LITERAL, ""); // NUMBER OF RESULTS - LEAVE BLANK SEEMS TO RETURN ALL171 return query;172 }173 // TODO - need to finish parsing174 internal IList<HospitalLocation> toAllClinics(string response)175 {176 IList<HospitalLocation> locations = new List<HospitalLocation>();177 if (String.IsNullOrEmpty(response))178 {179 return locations;180 }181 string[] lines = StringUtils.split(response, StringUtils.CRLF);182 if (lines == null || lines.Length == 0)183 {184 throw new MdoException(MdoExceptionCode.DATA_UNEXPECTED_FORMAT);185 }186 string[] metaLine = StringUtils.split(lines[0], StringUtils.EQUALS);187 string[] metaPieces = StringUtils.split(metaLine[1], StringUtils.CARET);188 Int32 numResult = Convert.ToInt32(metaPieces[0]);189 // metaPieces[1] = number of records requested (number argument). asterisk means all were returned190 // metaPieces[2] = ?191 for (int i = 1; i < lines.Length; i++)192 {193 string[] pieces = StringUtils.split(lines[i], StringUtils.EQUALS);194 if (pieces.Length < 2 || String.IsNullOrEmpty(pieces[1])) // at the declaration of a new result - create a new appointment type195 {196 if (lines.Length >= i + 2) // just to be safe - check there are two more lines so we can obtain the ID and name197 {198 HospitalLocation current = new HospitalLocation();199 current.Id = (StringUtils.split(lines[i + 1], StringUtils.EQUALS))[1];200 current.Name = (StringUtils.split(lines[i + 2], StringUtils.EQUALS))[1];201 locations.Add(current);202 }203 }204 }205 // TBD - should we check the meta info matched the number of results found?206 return locations;207 }208 #endregion209 210 #endregion211 public List<Site> getAllInstitutions()212 {213 throw new NotImplementedException();214 }...
PersonName.cs
Source:PersonName.cs
...17 public PersonName() {}18 19 public PersonName(String value)20 {21 if (!StringUtils.isEmpty(value))22 {23 splitName(value);24 }25 }26 public String Lastname27 {28 get29 {30 return lastname;31 }32 set33 {34 lastname = value;35 }36 }37 public String Firstname38 {39 get40 {41 return firstname;42 }43 set44 {45 firstname = value;46 }47 }48 public String Inits49 {50 get51 {52 return inits;53 }54 set55 {56 inits = value;57 }58 }59 public String Suffix60 {61 get62 {63 return suffix;64 }65 set66 {67 suffix = value;68 }69 }70 public String Prefix71 {72 get73 {74 return prefix;75 }76 set77 {78 prefix = value;79 }80 }81 public String Degree82 {83 get84 {85 return degree;86 }87 set88 {89 degree = value;90 }91 }92 private void splitName(String value)93 {94 String[] names = StringUtils.split(value,StringUtils.COMMA);95 if (names.Length == 1)96 {97 Lastname = value;98 Firstname = "";99 return;100 }101 Lastname = names[0];102 Firstname = names[1].Trim();103 }104 public String LastNameFirst105 {106 get107 {108 return getLastNameFirst();109 }110 set111 {112 if (StringUtils.isEmpty(value))113 {114 return;115 }116 splitName(value);117 }118 }119 public String getFirstNameFirst()120 {121 if (StringUtils.isEmpty(Lastname))122 {123 return "";124 }125 String s = Firstname + ' ';126 if (!StringUtils.isEmpty(Inits))127 {128 s += Inits + ' ';129 }130 s += Lastname;131 if (!StringUtils.isEmpty(Suffix))132 {133 s += Suffix + ' ';134 }135 return s;136 }137 public String getLastNameFirst()138 {139 if (StringUtils.isEmpty(Lastname))140 {141 return "";142 }143 StringBuilder name = new StringBuilder(Lastname);144 if (!StringUtils.isEmpty(Firstname))145 {146 name.Append(",");147 name.Append(Firstname);148 }149 if (!StringUtils.isEmpty(Inits))150 {151 name.Append(" ");152 name.Append(Inits);153 }154 if (!StringUtils.isEmpty(Suffix))155 {156 name.Append(Suffix);157 name.Append(" ");158 }159 return name.ToString();160 } 161 162 public String getFullName()163 {164 if (StringUtils.isEmpty(Lastname))165 {166 return "";167 }168 String s = "";169 if (!StringUtils.isEmpty(Prefix))170 {171 s += Prefix + ' ';172 }173 s += getFirstNameFirst();174 if (!StringUtils.isEmpty(Degree))175 {176 s += ", " + Degree;177 }178 return s;179 }180 public static bool isValid(string s)181 {182 if (StringUtils.isEmpty(s) || !StringUtils.isAlphaChar(s[0]))183 {184 return false;185 }186 for (int i = 1; i < s.Length; i++)187 {188 if (!StringUtils.isAlphaChar(s[i]) &&189 s[i] != ' ' && s[i] != '\'' && s[i] != '-' && s[i] != ',' && s[i] != '.')190 {191 return false;192 }193 }194 return true;195 }196 public override string ToString()197 {198 return getLastNameFirst();199 }200 }201}...
VistaRemindersDao.cs
Source:VistaRemindersDao.cs
...16 public string[] getReminderReportTemplates()17 {18 MdoQuery request = builtGetReminderReportTemplatesRequest();19 string response = (string)cxn.query(request, new MenuOption("AMOJ VL CPGPI"));20 return StringUtils.split(response, StringUtils.CRLF);21 }22 internal MdoQuery builtGetReminderReportTemplatesRequest()23 {24 VistaQuery vq = new VistaQuery("AMOJVL CPGPI GETCPGPIS");25 return vq;26 }27 public OrderedDictionary getActiveReminderReports()28 {29 MdoQuery request = builtGetActiveReminderReportsRequest();30 string response = (string)cxn.query(request, new MenuOption("AMOJ VL CPGPI"));31 return reminderReportNamesToMdo(response);32 }33 internal MdoQuery builtGetActiveReminderReportsRequest()34 {35 VistaQuery vq = new VistaQuery("AMOJVL CPGPI GETARPT");36 return vq;37 }38 internal OrderedDictionary reminderReportNamesToMdo(string response)39 {40 if (String.IsNullOrEmpty(response))41 {42 return null;43 }44 string[] lines = StringUtils.split(response, StringUtils.CRLF);45 OrderedDictionary result = new OrderedDictionary();46 for (int i = 0; i < lines.Length; i++)47 {48 if (String.IsNullOrEmpty(lines[i]))49 {50 continue;51 }52 string[] flds = StringUtils.split(lines[i], StringUtils.CARET);53 result.Add(flds[1], flds[0]);54 }55 return result;56 }57 public ReminderReportPatientList getPatientListForReminderReport(string rptId)58 {59 MdoQuery request = builtGetPatientListForReminderReportRequest(rptId);60 string response = (string)cxn.query(request, new MenuOption("AMOJ VL CPGPI"));61 ReminderReportPatientList result = toPatientListMdo(response);62 result.ReportId = rptId;63 return result;64 }65 internal MdoQuery builtGetPatientListForReminderReportRequest(string rptId)66 {67 VistaQuery vq = new VistaQuery("AMOJVL CPGPI GETPLIST");68 vq.addParameter(vq.LITERAL, rptId);69 return vq;70 }71 internal ReminderReportPatientList toPatientListMdo(string response)72 {73 if (String.IsNullOrEmpty(response))74 {75 return null;76 }77 string[] lines = StringUtils.split(response, StringUtils.CRLF);78 ReminderReportPatientList result = new ReminderReportPatientList();79 string[] flds = StringUtils.split(lines[0], StringUtils.CARET);80 result.ReportName = flds[1];81 flds = StringUtils.split(lines[1], StringUtils.CARET);82 result.ReportTimestamp = flds[1];83 for (int i = 2; i < lines.Length; i++)84 {85 if (String.IsNullOrEmpty(lines[i]))86 {87 continue;88 }89 flds = StringUtils.split(lines[i], StringUtils.CARET);90 // check for flds[1] being integer91 result.AddPatient(Convert.ToInt16(flds[1]), flds[3],flds[4],flds[5]);92 }93 return result;94 }95 }96}...
StringUtils
Using AI Code Generation
1use Behat\Gherkin\Node\PyStringNode;2use Behat\Gherkin\Node\TableNode;3use Behat\Behat\Context\Context;4use Behat\Behat\Context\SnippetAcceptingContext;5use Behat\Behat\Tester\Exception\PendingException;6use Behat\Behat\Hook\Scope\BeforeScenarioScope;7use Behat\Behat\Hook\Scope\AfterScenarioScope;8use Behat\Behat\Hook\Scope\BeforeFeatureScope;9use Behat\Behat\Hook\Scope\AfterFeatureScope;10use Behat\MinkExtension\Context\MinkContext;11use Behat\Testwork\Tester\Result\TestResult;12use Behat\Behat\Hook\Scope\AfterStepScope;13use Behat\Behat\Hook\Scope\BeforeStepScope;14use Behat\Behat\Hook\Scope\AfterScenarioScope;15use Behat\Behat\Hook\Scope\BeforeScenarioScope;16use Behat\Mink\Element\Element;17use Behat\Mink\Element\NodeElement;18use Behat\Mink\Exception\ElementNotFoundException;19use Behat\Mink\Exception\ExpectationException;20use Behat\Mink\Exception\UnsupportedDriverActionException;
StringUtils
Using AI Code Generation
1use Behat\Gherkin\Node\PyStringNode;2use Behat\Gherkin\Node\TableNode;3use Behat\Behat\Context\Context;4use Behat\Behat\Context\SnippetAcceptingContext;5use Behat\Behat\Tester\Exception\PendingException;6use Behat\Behat\Context\CustomSnippetAcceptingContext;7use Behat\MinkExtension\Context\MinkContext;8use Behat\MinkExtension\Context\RawMinkContext;9use Behat\Gherkin\Node\PyStringNode;10use Behat\Gherkin\Node\TableNode;11use Behat\Behat\Context\Context;12use Behat\Behat\Context\SnippetAcceptingContext;13use Behat\Behat\Tester\Exception\PendingException;14use Behat\Behat\Context\CustomSnippetAcceptingContext;15use Behat\MinkExtension\Context\MinkContext;16use Behat\MinkExtension\Context\RawMinkContext;17use Behat\Gherkin\Node\PyStringNode;18use Behat\Gherkin\Node\TableNode;19use Behat\Behat\Context\Context;20use Behat\Behat\Context\SnippetAcceptingContext;21use Behat\Behat\Tester\Exception\PendingException;22use Behat\Behat\Context\CustomSnippetAcceptingContext;23use Behat\MinkExtension\Context\MinkContext;24use Behat\MinkExtension\Context\RawMinkContext;25use Behat\Gherkin\Node\PyStringNode;26use Behat\Gherkin\Node\TableNode;27use Behat\Behat\Context\Context;28use Behat\Behat\Context\SnippetAcceptingContext;29use Behat\Behat\Tester\Exception\PendingException;30use Behat\Behat\Context\CustomSnippetAcceptingContext;31use Behat\MinkExtension\Context\MinkContext;32use Behat\MinkExtension\Context\RawMinkContext;33use Behat\Gherkin\Node\PyStringNode;34use Behat\Gherkin\Node\TableNode;35use Behat\Behat\Context\Context;36use Behat\Behat\Context\SnippetAcceptingContext;37use Behat\Behat\Tester\Exception\PendingException;38use Behat\Behat\Context\CustomSnippetAcceptingContext;39use Behat\MinkExtension\Context\MinkContext;40use Behat\MinkExtension\Context\RawMinkContext;
StringUtils
Using AI Code Generation
1use Behat\Gherkin\Filter\NameFilter;2use Behat\Gherkin\Filter\TagFilter;3use Behat\Gherkin\Filter\LineFilter;4use Behat\Gherkin\Filter\ScenarioFilter;5use Behat\Gherkin\Filter\FeatureFilter;6use Behat\Gherkin\Filter\CompositeFilter;7use Behat\Gherkin\Filter\FilterInterface;8use Behat\Gherkin\Filter\FilterFactory;9use Behat\Gherkin\Filter\FilterManager;10use Behat\Gherkin\Filter\FilterInterface;11use Behat\Gherkin\Filter\FilterFactory;12use Behat\Gherkin\Filter\FilterManager;13use Behat\Gherkin\Filter\FilterInterface;14use Behat\Gherkin\Filter\FilterFactory;15use Behat\Gherkin\Filter\FilterManager;16use Behat\Gherkin\Filter\FilterInterface;17use Behat\Gherkin\Filter\FilterFactory;18use Behat\Gherkin\Filter\FilterManager;19use Behat\Gherkin\Filter\FilterInterface;20use Behat\Gherkin\Filter\FilterFactory;21use Behat\Gherkin\Filter\FilterManager;22use Behat\Gherkin\Filter\NameFilter;23use Behat\Gherkin\Filter\TagFilter;24use Behat\Gherkin\Filter\LineFilter;25use Behat\Gherkin\Filter\ScenarioFilter;26use Behat\Gherkin\Filter\FeatureFilter;27use Behat\Gherkin\Filter\CompositeFilter;28use Behat\Gherkin\Filter\FilterInterface;29use Behat\Gherkin\Filter\FilterFactory;30use Behat\Gherkin\Filter\FilterManager;31use Behat\Gherkin\Filter\FilterInterface;32use Behat\Gherkin\Filter\FilterFactory;33use Behat\Gherkin\Filter\FilterManager;34use Behat\Gherkin\Filter\FilterInterface;35use Behat\Gherkin\Filter\FilterFactory;36use Behat\Gherkin\Filter\FilterManager;37use Behat\Gherkin\Filter\FilterInterface;
StringUtils
Using AI Code Generation
1require_once 'vendor/autoload.php';2use Behat\Gherkin\Node\PyStringNode;3use Behat\Gherkin\Node\TableNode;4use Behat\Gherkin\Node\ScenarioNode;5use Behat\Gherkin\Node\FeatureNode;6use Behat\Gherkin\Node\BackgroundNode;7use Behat\Gherkin\Node\StepNode;8use Behat\Gherkin\Node\OutlineNode;9use Behat\Gherkin\Node\ExampleNode;
StringUtils
Using AI Code Generation
1use Behat\Gherkin\Node\TableNode;2use Behat\Behat\Context\Step;3use Behat\Behat\Context\Step\Given;4use Behat\Behat\Context\Step\When;5use Behat\Behat\Context\Step\Then;6use Behat\Mink\Driver\Selenium2Driver;7use Behat\Mink\Exception\ExpectationException;8use Behat\Mink\Exception\UnsupportedDriverActionException;9use Behat\Mink\Exception\ElementNotFoundException;10use Behat\MinkExtension\Context\MinkContext;11use Behat\MinkExtension\Context\RawMinkContext;12use Behat\MinkExtension\Context\MinkContext;13use Behat\MinkExtension\Context\RawMinkContext;14use Behat\MinkExtension\Context\MinkContext;15use Behat\MinkExtension\Context\RawMinkContext;16use Behat\MinkExtension\Context\MinkContext;17use Behat\MinkExtension\Context\RawMinkContext;18use Behat\MinkExtension\Context\MinkContext;19use Behat\MinkExtension\Context\RawMinkContext;20use Behat\MinkExtension\Context\MinkContext;21use Behat\MinkExtension\Context\RawMinkContext;22use Behat\MinkExtension\Context\MinkContext;23use Behat\MinkExtension\Context\RawMinkContext;24use Behat\MinkExtension\Context\MinkContext;25use Behat\MinkExtension\Context\RawMinkContext;26use Behat\MinkExtension\Context\MinkContext;27use Behat\MinkExtension\Context\RawMinkContext;28use Behat\MinkExtension\Context\MinkContext;29use Behat\MinkExtension\Context\RawMinkContext;30use Behat\MinkExtension\Context\MinkContext;31use Behat\MinkExtension\Context\RawMinkContext;32use Behat\MinkExtension\Context\MinkContext;33use Behat\MinkExtension\Context\RawMinkContext;34use Behat\MinkExtension\Context\MinkContext;
StringUtils
Using AI Code Generation
1require_once 'vendor/gherkin/gherkin/src/Behat/Gherkin/Utils/StringUtils.php';2use Behat\Gherkin\Utils\StringUtils;3$utils = new StringUtils();4$utils->strlen('Hello World');5$utils->substr('Hello World', 6);6require_once 'vendor/gherkin/gherkin/src/Behat/Gherkin/Utils/StringUtils.php';7use Behat\Gherkin\Utils\StringUtils;8$utils = new StringUtils();9$utils->strlen('Hello World');10$utils->substr('Hello World', 6);
StringUtils
Using AI Code Generation
1$gherkin = new Gherkin\Gherkin();2$parser = $gherkin->getParser();3$document = $parser->parse($feature);4$printer = new Gherkin\Formatter\PrettyFormatter();5$printer->setOutput($output);6$printer->uri($feature);7$printer->feature($document->getFeature());8$printer->scenario($document->getFeature()->getChildren()[0]);9$printer->step($document->getFeature()->getChildren()[0]->getSteps()[0]);10$printer->match($document->getFeature()->getChildren()[0]->getSteps()[0], $match);11$printer->result($document->getFeature()->getChildren()[0]->getSteps()[0], $result);12$gherkin = new Gherkin\Gherkin();13$parser = $gherkin->getParser();14$document = $parser->parse($feature);15$printer = new Gherkin\Formatter\PrettyFormatter();16$printer->setOutput($output);17$printer->uri($feature);18$printer->feature($document->getFeature());19$printer->scenario($document->getFeature()->getChildren()[0]);20$printer->step($document->getFeature()->getChildren()[0]->getSteps()[0]);21$printer->match($document->getFeature()->getChildren()[0]->getSteps()[0], $match);22$printer->result($document->getFeature()->getChildren()[0]->getSteps()[0], $result);23$gherkin = new Gherkin\Gherkin();24$parser = $gherkin->getParser();25$document = $parser->parse($feature);26$printer = new Gherkin\Formatter\PrettyFormatter();27$printer->setOutput($output);28$printer->uri($feature);29$printer->feature($document->getFeature());30$printer->scenario($document->getFeature()->getChildren()[0]);31$printer->step($document->getFeature()->getChildren()[0]->getSteps()[0]);32$printer->match($document->getFeature()->getChildren()[0]->getSteps()[0], $match);33$printer->result($document->getFeature()->getChildren()[0]->getSteps()[0], $result
StringUtils
Using AI Code Generation
1use Behat\Gherkin\Node\PyStringNode;2public function iHaveAString(PyStringNode $string)3{4 echo $string;5}6use Behat\Gherkin\Node\TableNode;7public function iHaveATable(TableNode $table)8{9 echo $table;10}111 scenario (1 passed)122 steps (2 passed)130m0.01s (9.62Mb)141 scenario (1 passed)152 steps (2 passed)160m0.01s (9.62Mb)
StringUtils
Using AI Code Generation
1$gherkin = new Gherkin\Gherkin();2$parser = $gherkin->getParser();3$document = $parser->parse('Feature: test4Given I have 1 cukes in my belly');5$feature = $document->getFeature();6$steps = $feature->getChildren()[0]->getSteps();7$step = $steps[0];8echo $step->getText();9$gherkin = new Behat\Gherkin\Gherkin();10$parser = $gherkin->getParser();11$document = $parser->parse('Feature: test12Given I have 1 cukes in my belly');13$feature = $document->getFeature();14$steps = $feature->getChildren()[0]->getSteps();15$step = $steps[0];16echo $step->getText();17$gherkin = new Behat\Gherkin\Gherkin();18$parser = $gherkin->getParser();19$document = $parser->parse('Feature: test20Given I have 1 cukes in my belly');21$feature = $document->getFeature();22$steps = $feature->getChildren()[0]->getSteps();23$step = $steps[0];24echo $step->getText();25$gherkin = new Behat\Gherkin\Gherkin();26$parser = $gherkin->getParser();27$document = $parser->parse('Feature: test28Given I have 1 cukes in my belly');29$feature = $document->getFeature();30$steps = $feature->getChildren()[0]->getSteps();31$step = $steps[0];32echo $step->getText();
Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.
Test now for FreeGet 100 minutes of automation test minutes FREE!!