Skip to content

Commit 4d42dad

Browse files
authored
Merge pull request #508 from intersystems/issue-495
Fix hl7 extensions inconsistencies
2 parents c712f60 + fc15782 commit 4d42dad

File tree

2 files changed

+32
-1
lines changed

2 files changed

+32
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1717
- Changed prompts in configure from 0/1 to no/yes (#461)
1818
- Added warnings when user is using incompatible git version (#488)
1919
- Fixed the back button navigation between WebUI and Settings page (#361)
20+
- Fixed issues with HL7 file extension inconsistencies (#495)
2021
- Basic mode Sync operation now imports items changed on the remote merge branch (#506)
2122
- Fetch diff output uses correct remote branch (#509)
2223
- Properly handle more cases of truncated filenames from git pull (#511)

cls/SourceControl/Git/Utils.cls

Lines changed: 31 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -632,7 +632,36 @@ ClassMethod NormalizeFolder(folder As %String) As %String
632632

633633
ClassMethod ExternalName(InternalName As %String, ByRef MappingExists As %Boolean) As %String
634634
{
635-
quit $Replace(..Name(.InternalName,.MappingExists),"/",..#Slash)
635+
set root = ..TempFolder()
636+
set file = $Replace(..Name(.InternalName,.MappingExists),"/",..#Slash)
637+
set fullFile = root_file
638+
if '..Exists(.fullFile) {
639+
quit file
640+
}
641+
quit $Piece(fullFile,root,2,*)
642+
}
643+
644+
/// Check if file exists but case insensitive on file extension
645+
/// Stolen from %IPM.Utils.File
646+
ClassMethod Exists(ByRef pFilename) As %Boolean
647+
{
648+
If ##class(%File).Exists(pFilename) {
649+
Return 1
650+
}
651+
Set tDirectory = ##class(%File).ParentDirectoryName(pFilename)
652+
If '##class(%File).DirectoryExists(tDirectory) {
653+
Return 0
654+
}
655+
Set tName = $Piece(pFilename, tDirectory, 2, *)
656+
Set tFileName = $Piece(tName, ".", 1, * - 1)
657+
Set tFileExt = $Piece(tName, ".", *)
658+
for tExt = $$$LOWER(tFileExt), $$$UPPER(tFileExt) {
659+
If ##class(%File).Exists(tDirectory _ tFileName _ "." _ tExt) {
660+
Set pFilename = tDirectory _ tFileName _ "." _ tExt
661+
Return 1
662+
}
663+
}
664+
Return 0
636665
}
637666

638667
ClassMethod AddToServerSideSourceControl(InternalName As %String) As %Status
@@ -2711,3 +2740,4 @@ ClassMethod BaselineExport(pCommitMessage = "", pPushToRemote = "") As %Status
27112740
}
27122741

27132742
}
2743+

0 commit comments

Comments
 (0)